Background Color
Syntax:
background-color: <value>
The background-color property sets the background color of an element.
Example: 1
<html>
<head>
<style type="text/css">
body
{
</style>
</head>
<body>
</body>
</html>
<head>
<style type="text/css">
.background
</head>
</html>
<head>
<style type="text/css">
body
{
background-color:#1078E1;
}</style>
</head>
<body>
</body>
</html>
Another Way:
<html><head>
<style type="text/css">
.background
{
background-color:#1078E1;
}
</style>background-color:#1078E1;
}
</head>
<body class="background">
</body></html>
Output
Whole background is filled with the #1078E1 color.
Example: 2
<html>
<head>
<style type="text/css">
</head>
<body>
</html>
<head>
<style type="text/css">
h4 { background-color:#009999;}
p { background-color:#A0A0A0; }
</style>p { background-color:#A0A0A0; }
</head>
<body>
<h4>This is a heading.</h4>
<p>This is a paragraph.</p>
</body><p>This is a paragraph.</p>
</html>
Output