An Interest In:
Web News this Week
- April 18, 2024
- April 17, 2024
- April 16, 2024
- April 15, 2024
- April 14, 2024
- April 13, 2024
- April 12, 2024
April 21, 2021 10:35 am GMT
Original Link: https://dev.to/pawanbhayde/2-css-property-background-attachment-pic
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:
Tweet
View Full Article
Dev To
An online community for sharing and discovering great ideas, having debates, and making friendsMore About this Source Visit Dev To