Extensible HyperText Markup Language

background-attachment

Definition

The background-attachment property specifies if background images should scroll or be fixed in the browser window. The following screen shot shows a Web browser with a background image of a giraffe in the bottom right corner. The background-attachment property is set to fixed so that during scrolling in the browser, the image does not move.

Screen shot of a Web browser with an image in the bottom right corner. The entire image is shown.

The following screen shot shows a Web browser with a background image of a giraffe in the bottom right corner. The background-attachment property is set to scroll so that during scrolling in the browser, the image will be clipped by the viewable area.

Screen shot of a Web browser with an image in the bottom right corner. A portion of the image is clipped be the viewable area.

Example

  1. body {
  2. background: white url('images/giraffe.gif');
  3. background-repeat: no-repeat;
  4. background-position: right bottom;
  5. background-attachment: fixed;
  6. }

Characteristics

Possible values

scroll
Background images don't move with the scrolling mechanism of the Web browser.
fixed
Background images don't move with the element.
inherit
Use the same computed value as the parent element for this property.

Default value

scroll

Applies to

Inherited

No

See also

XStandard XHTML WYSIWYG editor
A standards-compliant WYSIWYG editor component for content management applications. The editor generates valid XHTML and uses CSS for formatting. Free version is available.

Check out XStandard