CSS

CSS Intro

CSS Intro Quiz

CSS Intro Exercise

CSS Basic

CSS Basic Quiz

CSS Basic Exercise

CSS Advance

CSS Advance Quiz

CSS Advance Exercise

CSS3

CSS3 Quiz

CSS3 Exercise

CSS Properties

CSS Functions

CSS Selectors

Background Attachment in CSS

The background-attachment Property

 

 

The background-attachment property sets whether a background image will be fixed or scroll with the page. If set to fixed, then the image will not move even if the user scroll. When set to scroll, the background image will scroll with the rest of the content.

 

Syntax:-

 

Its syntax is:-

< style >

element{

background-attachment: scroll| fixed| local| initial| inherit;

}

< /style >

 

Further Explanation:-

 

Value Description
scroll The background image will scroll with the page.
fixed The background image will not scroll with the page
local The background image will scroll with the element's contents
initial Sets this property to its default value.
inherit Inherits this property from its parent element.

Code Explanation

All Tutorials related to CSS Advance

All Sections related to CSS