Glubase - share your knowledge


All / Computers / Programming / CSS





  • View Command

CSS Reference

CSS background-attachment definition

Browser support
IEFFOpSaf

Type:

Syntax

background-attachment: <attachment>

Description

The CSS background-attachment property defines if the background should scroll with the content of the document or be fixed.

Values

Value Description

scroll

The default value scroll makes the background scroll with the other content of the webpage.
fixed The value fixed stops the background from scrolling with the other content of the webpage.

See Also

 background, background-color, background-image, background-position and background-repeat.

Example

[Try this example yourself]
<style type="text/css">
.fixedstyle

background-image: url(http://www.glubase.com/images/glubase2.gif); 
background-attachment: fixed
}
</style>

<div class="fixedstyle">
  hello<br />hello<br />hello<br />hello<br />hello<br />hello<br />
  hello<br />hello<br />hello<br />hello<br />hello<br />hello<br />
  hello<br />hello<br />hello<br />hello<br />hello<br />hello<br />
  hello<br />hello<br />hello<br />hello<br />hello<br />hello<br />
  hello<br />hello<br />hello<br />hello<br />hello<br />hello<br />
</div>

Output

hello
hello
hello
hello
hello
hello
hello
hello
hello
hello
hello
hello
hello
hello
hello
hello
hello
hello
hello
hello
hello
hello
hello
hello
hello
hello
hello
hello
hello
hello
  • Comments

No comments added.