Using double classes to your advantage

Have you ever made up a single class just for one instance of something in an html page? Well, did you know you can set a double class?

According to the heirarchy of CSS and inheritance of properties, the second listed class always takes precedence. Add a space between the two classes.

<Td class=”blue redletters”>

Here are the properties for each of these declarations

.blue{

color:#666;

font-size:12px;

}

.redletters{

color:#777;

}

The last use of the color property, in this instance, for redletters, is the one that takes precedence. This gets around the silly usage of some <span> tags just for a single class.

Here are some similar arcade posts
Print This Post Print This Post

If you enjoyed this post, please consider to leave a comment or subscribe to the feed and get future articles delivered to your feed reader.

Comments

No comments yet.

Leave a comment

(required)

(required)