Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
April 21, 2021 10:35 am GMT

2 CSS PROPERTY - BACKGROUND ATTACHMENT

Value: scroll | fixed

Initial: scroll

Applies to: all elements

Inherited: no

Percentage values: N/A

If a background image is specified, the CSS property "background-attachment" determines if the image is in a fixed position in relation to the screen or if it scrolls with the content.

Example:

body{background-color: red;background-image: url(image.gif);background-repeat: repeat-y;background-attachment: fixed;}

CSS1 core: UAs may treat "fixed" as "scroll". However, it is recommended they interpret "fixed" correctly, at least on the "HTML" and "BODY" elements, since there is no way for an author to provide an image only for those browsers that support "fixed".


Original Link: https://dev.to/pawanbhayde/2-css-property-background-attachment-pic

Share this article:    Share on Facebook
View Full Article

Dev To

An online community for sharing and discovering great ideas, having debates, and making friends

More About this Source Visit Dev To