CSS background properties are used to define the background effects of an element.
CSS properties used for background effects:
- background-color
- background-image
- background-repeat
- background-attachment
- background-position
Background Color
The background-color property specifies the background color of an element.
The background color of a page is defined in the body selector:
Code:
body {background-color:#b0c4de;}
With CSS, a color is most often specified by:
1 - a HEX value - like "#ff0000"
2 - an RGB value - like "rgb(255,0,0)"
3 - a color name - like "red"
In the example below, the h1, p, and div elements have different background colors:
Code:
h1 {background-color:#6495ed;}
p {background-color:#e0ffff;}
div {background-color:#b0c4de;}
to be continued..................