HTML and CSS Reference
In-Depth Information
allowed values (e.g., the repeat, position, and so on) to their defaults if the values are not ex-
plicitly supplied. Thus, the following two rules will have the same appearance:
background: yellow;
background: yellow none top left repeat;
Furthermore, these defaults can override previous declarations made with more specific back-
ground properties. For example, given the following rules:
h1 {background-repeat: repeat-x;}
h1, h2 {background: yellow url(headback.gif);}
…the repeat value for both h1 and h2 elements will be set to the default of repeat , overriding
the previously declared value of repeat-x .
When declaring multiple backgrounds, only the last may have a background color. In cases
where multiple background images overlap, the images are stacked with the first highest and
the last lowest. This is the exact reverse of how overlapping is handled in CSS positioning,
and so may seem counterintuitive.
Examples:
body {background: white url(bg41.gif)
fixed center repeat-x;}
p {background:
url(/pix/water.png) center repeat-x,
top left url(/pix/stone.png) #555;}
pre {background: yellow;}
Search WWH ::




Custom Search