HTML and CSS Reference
One final refinement you can toss into the mix comes with the background-attachment property.
Via background-attachment , you can set the image to scroll with the window (the default behav-
ior) or stay in its original fixed position. The two primary values for background-attachment are
scroll and fixed .
CSS allows you to define these properties separately or as a group under the background property.
For example, this verbose code:
background-position: left top;
could be written much more succinctly:
background: black url(“..images/header_bg.png”) repeat-x left top scroll;
You can safely mix any number of background properties — you don't have to include them all.
In this Try It you learn how to add a background image to the page.