Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 3. Images and Other Design Eleme... > How do I fix my background image in ...

3.6. How do I fix my background image in place while the page is scrolled?

You’ve probably seen sites on which the background image stays static while the content scrolls over it. This effect is achieved using the background-attachment property.

3.6.1. Solution

We can use the background-attachment property with a value of fixed. This will fix the background so that it remains stationary while the content moves:


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint