answersLogoWhite

0

In CSS can a background be fixed?

Updated: 8/17/2019
User Avatar

Wiki User

13y ago

Best Answer

To set a fixed background image use the following:

body

{

background-image:url('your_image.gif');

background-repeat:no-repeat;

background-attachment:fixed;

}

....taken from the w3schools tutorial.

User Avatar

Wiki User

13y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: In CSS can a background be fixed?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Which CSS property for the background can be used to specify that scrolling will not move the image from its set position?

The property you are referring to is called the background-attachment property. This property accepts three values, scroll, fixed, or inherit. The default is scroll. However, to set the background to not scroll, you would do: background-attachment: fixed;


Stretch a HTML Background?

Current CSS does not allow resizing a background image. Hopefully, CSS 3.0 will address that issue.


How Can you Scroll Page With Fixed Element?

To your elements CSS add:position: fixed;


How to register in Friendster?

- Open "Edit Profile" - Select "Customize" - At Customize CSS just fill this :body { background-image: url(your image url); background-attachment: fixed; background-position: top center; background-repeat: no-repeat; background-color: transparent; cursor: ; } example :body { background-image: url(http:/www.de-angel.com/Friendster/FS.GIF); background-attachment: fixed; background-position: top center; background-repeat: no-repeat; background-color: transparent; cursor: ; }


What CSS property specifies the background color of a table?

Use the CSS declaration "background-color" For instance... <style type="text/css"> body { background-color: red; } </style> That code will change the background color to red. Background color will take the same values for a color as all other CSS color. A named color keyword, a hex RGB value, a decimal RGB value, and a decimal RGBA value.


Where can a css background image be found?

A css background image is another name for a computer wallpaper.They can be found on Photobucket, SantaBanta Wallpaper, Deviant Art and Free Wallpapers.


How to use CSS in making the picture a background?

To make a picture a background of a web site using CSS, you will use the different background properties, which are: background-color, background-image, background-repeat, background-attachment, and background-position. The specific property you are looking for is background-image. To use this property you would declare in your style sheet the following: body { background-image: url('paper.jpg'); } This is telling the web browser to use the image paper.jpg and make it the background of the entire page. The other background properties control whether the backgound is repeated along the x and/or y axis, the position on the screen the image begins at, whether the background is fixed or scrolls with the page, and the background color.


What is a CSS in a MySpace?

CSS means cascading style sheet, CSS in a myspace profile styles the profile to look different using colors and background images.


What is image background with examples?

Background Image Code: For the body tag example: body { width: XXpx; height: YYpx; margin: 0 auto; background: #fff url(image_name.jpg) no-repeat center scroll; } That is the proper CSS code for a non-tile image where the contents scroll with the background image. Change "#fff" to preferred bg color. Change "scroll" to "fixed" if you want page contents to scroll over bg image. Be sure to set proper width/height to provide minimum page size to display bg image. Put the CSS as is on an external CSS file. If using embedded CSS, then place CSS between the style tags and place those style tags between the head tags of the page.


How do you add an image to your background on your wikia?

Depends on how you are able to edit the code. This is the basic CSS way for a web page: Background Image Code: For the body tag example: body { width: XXpx; height: YYpx; margin: 0 auto; background: #fff url(image_name.jpg) no-repeat center scroll; } That is the proper CSS code for a non-tile image where the contents scroll with the background image. Change "#fff" to preferred bg color. Change "scroll" to "fixed" if you want page contents to scroll over bg image. Be sure to set proper width/height to provide minimum page size to display bg image. Put the CSS as is on an external CSS file. If using embedded CSS, then place CSS between the style tags and place those style tags between the head tags of the page.


What is shorthand in a style sheet?

there are a few shorthand properties in css such as Shorthand version: .bla { background:#000 url(www.somewhere.com/pic.jpg) fixed top no-repeat; } Longhand version: .bla { background-color:#000; background-image:url background-attachment:fixed; background-position:top; background-repeat:no-repeat; } both versions do the same thing but obviously the first one is well shorter


How do you write the CSS and HTML code for an embedded style sheet that configures a background color of?

<style type="text/css" media=screen> body{ background-color: gray;} </style>