CSS div class background color
CSS Tutorial » CSS div class background color
CSS div class background-color property specifies the background color of a class.
Syntax:
Syntax: class background-color property CSS.
.class_name {
background-color: value;
}
Note: use external CSS instead.
With CSS, a background-color property is most often specified by:
- color name - like "red"
- HEX value - like "#ff0000"
- RGB value - like "rgb(255,0,0)"
How to create CSS div class background color - examples
You can try to execute the following code to change background-color property of a div on this page.
Example:
Example 1, How to create CSS div class background color - examples:
<!DOCTYPE html>
<html>
<head>
<title>How to create CSS div class background color - examples - example</title>
<style>
#first_box {
width: 380px;
border: 2px solid #00FF00;
background-color: #FFFF99;
}
.second_box { width: 276px;
border: 2px solid #0000FF;
margin-top: 18px;
background-color: #FFCC99; }
</style>
</head>
<body>
<div id="first_box"> <h1>How to create CSS div class background-color property</h1> Create CSS div class background-color property
<div class="second_box">How to create div CSS id and class property - examples - example.</div> </div>
<div class="second_box">Add your text here
This it is some text</div>
</body>
</html>
Note: Use external CSS instead.
css div style background color, how to put a background color in css
CSS div class background color - css tutorial
Online Editor
This tool makes it easy to create, adjust, and experiment with custom colors for the web.
HTML Templates

Magnews2 is a modern and creative free magazine and news website template that will help you kick off your online project in style.
CSS HTML Layout

Find here examples of creative and unique website layouts.
Free CSS HTML Menu

Find here examples of creative and unique website CSS HTML menu.