CSS Overriding Styles
The easiest way to override CSS style declarations is to place that element inside a new container and define what it should appear like in that context. In this example, a paragraph with the class redOrNot will appear red everywhere except for when it's placed inside an override element.
HTML Example:
This is red
and this is not, even though it's the same class
CSS Example:
p.redOrNot { color: red }
.override p.redOrNot { color: blue }
Result:
This is red
and this is not, even though it's the same class
Depending on your needs, you can further override the overriding. Following the example above, you can simply define another element inside an override one that acts in a totally different way. As a homework, define a context where you can place a paragraph of the redOrNot class that shows in a red font and yellow background.
Share Tweet