Wednesday, May 2, 2012

CSS order

You can apply multiple css to one html element.

<p class=”class1 class2”>abc</p>


Both “class1” and class2 will be applied to the paragraph. if class1 and class 2 has the definition for the same thing, e.g. backgroud, the one declared later wins out.



It does not matter class=”class1 class2” or class=”class2 class1”. But the declaration order of class 1 and class2 does matter.



About css order, reference is here

No comments:

Post a Comment