CSS Reference
D.7 Background Properties
With these p roperties, you can control the appearance of the backgr ound of an element
by spec ifying a color or inc luding an image.
background-color
The background-color CSS p roperty gives a color to the b ackgrou nd of an element.
Note that background lies underneath the borde r, so if you use a no n-solid border such
as dotted or dashed, the background colo r will show through the spaces between the
dots or dashes. Back ground a lso lies und erneath a ba ckground image and will not be
seen if a b ackgrou nd image is specified unless the image is not fully op aque.
Values
Any valid <color> value can be used.
Default Value
transparent
Examples
background-color: magenta;
background-color: transparent;
background-image
The background-image CSS prope rty enables authors to put an image into the back-
ground of an element. All the other parts of the element (including the border) sit on
top of the background image except for the back ground color, which hides und erneath
the image. If either the width or height (or both) of the image are sm aller than the
width and height of the element, then the image will tile. If the image doesn’t fit, it
will be clipped.
Values
A <url> of the image, or the none keyword.
Default Value
none
Example
background-image: url(/backgrounds/sky.jpg);
D.7. Backgroun d Properties 357
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.147.81.154