I have a simple question that I can't seem to find any documentation on the internet for. It's possible that my search terms were not quite right...
Let's consider a CSS class called centered
, which centers elements and performs other actions.
I am wondering if all elements of the news
class can inherit from the centered
class.
There are a few solutions to this:
Define all the attributes of
centered
innews
.centered { X; Y; Z } .news { X; Y; Z; A; B }
Add both classes to my HTML tags:
.centered { X; Y; Z } .news { A; B }
<div class="news centered">...</div>
I'm looking for a way to achieve something like this:
.centered { X; Y; Z }
.news { all_the_properties_of_centered; A; B }
then I could declare my news with
<div class="news">...</div>
Is it feasible?