Export (0) Print
Expand All
top
Expand Minimize

background-attachment

important noteImportant

This documentation is preliminary and subject to change.

Sets how the background image is attached to the object within the document.

Syntax

{ background-attachment: sAttachment }

Possible values

sAttachment

String that specifies or receives one of the following values:

scroll

Default. Background image scrolls with the object as the document is scrolled.

fixed

Background image stays fixed within the viewable area of the object.

The property has a default value of scroll. It is not inherited.

Remarks

This property can be set with the other background properties by using the background composite property.

Examples

The following example uses the background-attachment property to set the background to fixed, so that the background does not scroll with the text. This example uses an inline style sheet to set the background to fixed:

<style >
    body { background-attachment: fixed; }
</style>
</head><body background="some.jpg">

Standards information

This property is defined in Cascading Style Sheets (CSS), Level 1 (CSS1) Ee371212.xtlink_newWindow(en-us,Expression.40).png.

Applies to

a, address, b, big, blockquote, body, button, caption, center, cite, code, col, colgroup, custom, dd, defaults, dfn, div, dl, dt, em, fieldset, form, hn, html, i, iframe, img, input type=button, input type=checkbox, input type=file, input type=image, input type=password, input type=radio, input type=reset, input type=submit, input type=text, li, ol, option, p, s, span, sub, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, var, xmp

See also

Send feedback about this topic to Microsoft. © 2011 Microsoft Corporation. All rights reserved.

Community Additions

ADD
Show:
© 2014 Microsoft