I have a id based CSS file where I noticed I’m mostly repeating myself. What I’d like to do is specify that an item with an id follows a certain class + some other rules. For example: I’d like id id1 to have all the properties of class LinkButton applied as well as the value back-color: green. Is there a way to do this in the css file? Is there a better way to do what I’m looking at?
I have a id based CSS file where I noticed I’m mostly repeating myself.
Share
You can specify multiple selectors on a given set of properties, like this:
It can also override any of the properties if you need:
Or you give the element the class and ID: