I want to override the parent css in child element. I want to underline the parent element, but not the child element.
.parent {
text-decoration: underline;
color: red;
}
.child {
color: green;
text-decoration: none !important;
}
.sub-child {
color: green;
text-decoration: none !important;
}
<div class="parent">Inside parent
<div class="child">Inside first child
<div class="sub-child">Inside 1st child of 1st child
</div>
</div>
<div class="child">Inside 2nd child
<div class="sub-child">Inside 1st child of 2nd child</div>
<div class="sub-child">Inside 2nd child of 2nd child</div>
</div>
<div class="child">
Inside 3rd child
<div class="sub-child">Insde 1st child of 3rd child</div>
</div>
</div>