How to avoid CSS inheritance to keep linear gradient background-color intact?
Basically I want to avoid giving background color red from "box" (class name) div to .box-child
div. I want .box-child
to keep the initial background color set on .main-box
div.
Normally I would just set background color back to what it was, but it is a linear gradient background and if I set it back on a small area it doesn't look what it is supposed to look like. I want to keep it intact.
.main-box {
color: white;
height: 500px;
background: linear-gradient( 180deg, rgba(2, 0, 36, 1) 0%, rgba(84, 9, 121, 1) 35%, rgba(0, 212, 255, 1) 100%);
}
.box {
height: 300px;
background: red;
}
.box-child {
height: 150px;
inherits: none;
}
<div class="main-box">
MAIN BOX
<div class="box">
BOX
<div class="box-child">
BOX CHILD
</div>
</div>
</div>