CSS Background Color Tutorial

Css background color defines the background color of a div or page in html document.


Css style code background color

.backgroundgreen   {background: #339900;}
.backgroundyellow {background-color:#FFFF99;}

Html code background color

<div class="backgroundgreen">This area's background color is green</div><br />
<div class="backgroundyellow">This area's background color is yellow</div><br />

HTML Output
This area's background color is green

This area's background color is yellow


You can use both "background" and "background-color" in your css classes.

You can also set your html page document background color in your css body class.