codescracker


css

CSS Background Attachment



« Previous Tutorial Next Tutorial »


The background-attachment Property

The background-attachment property is used to fix or scroll the background image along with the text and other content displayed on it.

The background-attachment property takes either of the two values describes in the table given below:

Value Description
fixed If the value is set to fixed, the background image does not move with the text when the Web page is scrolled.
scroll If the value is set to scroll, the background image scrolls along with the text written over it. The default value of the background-attachment property is scroll.

The following code fragment shows how to use the background-attachment property:

body
{
	background-image: url('myimage.gif');
	background-attachment: scroll;
}

« Previous Tutorial Next Tutorial »



Tools
Calculator

Quick Links
Signup - Login - Give Online Test