Grokking CSS for Web Development
Vote

0% completed

​

Background Attachment

What should a background image do when the reader scrolls? It can travel up with the content, like a picture printed on the page, or it can stay where it is in the window while the content slides over it. The background-attachment property makes that choice, and it has three values: scroll, fixed, and local.

The running example

The travel card is now one of six cards on a page tall enough to scroll. The page background is cream, with one large orange circle, a sun, in the top-right corner.

<!DOCTYPE html> <html> <head> <title>Background Attachment</title>

.....

.....

.....

Like the course? Get enrolled and start learning!

Reading Progress

0%


Vote for new content