<div id = "first_div">First Div
<div id = "second_div">Second div
<div id = "third_div">Third Div</div>
<div id = "fourth_div">Fourth Div</div>
</div>
</div>
div{
margin: 2em;
height: 7em;
text-align: center;
text-transform: uppercase;
font-family: Verdana;
font-weight: 900;
color: white;
}
#first_div {
--my_bg: orange;
background-color: var(--my_bg);
}
#second_div {
background-color: var(--my_bg);
}
#third_div {
--my_bg: green;
background-color: var(--my_bg);
}
#fourth_div {
background-color: var(--my_bg);
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.