Export (0) Print
Expand All

background-attachment

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

{ background-attachment: sAttachment }

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.

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

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">

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

Community Additions

ADD
Show:
© 2014 Microsoft