How can i inherit properties from the css id rule to the css class?

css, inheritance

Solution

Just include the ID class on the upper declartion, the last declaration for any property wins. E.g. if the first rule had a `color: Green;`, `.test` would be green, `#divNew` would still be red.

.test, #divNew{ text-align:center; font-family:Verdana; }
#divNew{ color: Red; }

Problem

I have a css class rule: ``` .test{ text-align:center; font-family:Verdana; } ``` And i want to create another id rule (I hope It is right calling by "id rule" ): ``` #divNew1{ color: Red; } #spanNew2{ color: Green; } #pNew3{ color: Yellow; } ``` I have a lot of div elements. I want to pass .test class properties to other elements with only changing css file. That's why i don't want to add class attribute to div elements. The html code below: ``` <div id="divNew1">Ta ta taaaaa</div> <span id="spanNew2">Ta ta taaaaa</span> <p id="pNew3">Ta ta taaaaa</p> ``` But i want to add .test class properties to #divNew class by using inheritance and i don't want to add class attribute to the div like as above. Is there any way to do this?

Original source