Jump to content

Making custome text tags for CSS - a bad idea?


MuscovyX

Recommended Posts

It's a bad idea if you want your pages to validate. And if you're using a Strict DTD, it is possible that IE will get upset and drop into quirksmode, which will spoil your design. (Actually the thing you're discussing should have been possible with XHTML, but that hasn't happened.)It sounds like you're doing what the <span> element was designed for.I don't know if it will help or not, but are you aware that you can use more than one class name in an element's class attribute? This makes it possible to combine style properties very efficiently. Example:CSS

.red {	color:#f00;}.bold {   font-weight:bold;}

HTML

This text prints <span class="red">RED</span>.This text prints <span class="bold">BOLD</span>.This text prints <span class="bold red">BOLD AND RED</span>.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...