CSS3 > Background

Background-color Property in CSS3

How to set the background color for different elements in CSS3?


By using background-color property we can set the background color for different elements.

<style>
        p {
        background-color:orange;
        }
        b {
        background-color:none;
        }
        div {
        background-color:green;
        }
</style>

<body>
    <p>This is TechFunda.com in 'P' element.</p>
    <b>This is TechFunda.com in 'B' element.</b>
    <br />
    <br />
    <div>This is TechFunda.com in 'DIV' element.</div>
    <br />
    <h3>This is an INDIAN TechFunda.com</h3>
</body>

In the above code snippet we have given background-color property with different colors to the <p> element, <b> element, <div> element and <h3> element. 

OUTPUT

 Views: 659 | Post Order: 46



Write for us