CSS - Which method is better?

Posted by Joe on Stack Overflow See other posts from Stack Overflow or by Joe
Published on 2010-03-26T02:23:05Z Indexed on 2010/03/26 2:33 UTC
Read the original article Hit count: 309

Filed under:
|

Which is better in regards to processing time but also taking into account ease of use for a developer?

.font_small{ font-size:10px; }
.font_blue{ color:blue; }
.font_red{ color:red; }

<span class="font_small font_blue">Hello World!</span><br />
<span class="font_small font_red">Today's the day!</span>

OR

.font_blue_small{ color:blue; }
.font_red_small{ color:red; }

.font_blue_small .font_red_small { font-size:10px; }

<span class="font_blue_small">Hello World!</span><br />
<span class="font_red_small">Today's the day!</span>

OR

.font_blue_small{ color:blue; font-size:10px; }
.font_red_small{ color:red; font-size:10px; }

<span class="font_blue_small">Hello World!</span><br />
<span class="font_red_small">Today's the day!</span>

OR

Another option I haven't though of yet...?

© Stack Overflow or respective owner

Related posts about css

Related posts about stylesheet