Thursday 19 July 2012

How to Set the background color of different elements using css


<!DOCTYPE html>
<html>
<head>
<style type="text/css">
h1
{
background-color:#6495ed;
}
p
{
background-color:#e0ffff;
}
div
{
background-color:#b0c4de;
}
</style>
</head>

<body>

<h1>CSS background-color example!</h1>
<div>
This is a text inside a div element.
<p>This paragraph has its own background color.</p>
We are still in the div element.
</div>

</body>
</html>

0 Responses to “How to Set the background color of different elements using css”

Post a Comment