Is there a way to create a new class in CSS that ignores all inherited styles without needing to use !important for each one individually?
This is my HTML code:
<div class="text">
<h2>Title</h2>
<span>Date</span>
<p>Text here...</p>
<div class="sub-text">
<p>More text!</p>
<span>Thanks!</span>
</div>
</div>
Related CSS:
.text {width:100%; float:left;}
.text h2 {font-size: 20px;}
.text span {font-size: 12px; font-style: italic;}
.text p {font-size: 12px;}
.sub-text {width: 100%; float: left;}
.sub-text p {I wish to override all inherited classes without resorting to using !important}
.sub-text span {I would like to ignore the inherited styles without relying on the !important declaration}