CSS - background-color
background-color
defines a background color for the element
Property Variable Name
background-color
Available Values for background-color
#000000|transparent|initial|inherit
Examples Using background-color values
Example using background-color #000000
Example using background-color #000000
Here is an example using background-color:#000000;
Code
<style>
.demo-box-1 {
border-radius:3px;
margin-bottom:10px;
border:1px solid #000;
height:220px;
width:100%;
display: flex;
flex-wrap: wrap;
background-color:#000000;
}
</style>
<h2>Example using background-color #000000</h2>
<p>Here is an example using <code>background-color:#000000;</code></p>
<div class='demo-box-1'>
</div>
Example using background-color transparent
Example using background-color transparent
Here is an example using background-color:transparent;
Code
<style>
.demo-box-2 {
border-radius:3px;
margin-bottom:10px;
border:1px solid #000;
height:220px;
width:100%;
display: flex;
flex-wrap: wrap;
background-color:transparent;
}
</style>
<h2>Example using background-color transparent</h2>
<p>Here is an example using <code>background-color:transparent;</code></p>
<div class='demo-box-2'>
</div>
Example using background-color initial
Example using background-color initial
Here is an example using background-color:initial;
Code
<style>
.demo-box-3 {
border-radius:3px;
margin-bottom:10px;
border:1px solid #000;
height:220px;
width:100%;
display: flex;
flex-wrap: wrap;
background-color:initial;
}
</style>
<h2>Example using background-color initial</h2>
<p>Here is an example using <code>background-color:initial;</code></p>
<div class='demo-box-3'>
</div>
Example using background-color inherit
Example using background-color inherit
Here is an example using background-color:inherit;
Code
<style>
.demo-box-4 {
border-radius:3px;
margin-bottom:10px;
border:1px solid #000;
height:220px;
width:100%;
display: flex;
flex-wrap: wrap;
background-color:inherit;
}
</style>
<h2>Example using background-color inherit</h2>
<p>Here is an example using <code>background-color:inherit;</code></p>
<div class='demo-box-4'>
</div>