MuscovyX Posted April 9, 2010 Share Posted April 9, 2010 For a while now, I've been making up tags like <np></np> to put around text, so I can use multiple styles. I was wondering, is this a bad idea? Link to comment Share on other sites More sharing options...
jeffman Posted April 10, 2010 Share Posted April 10, 2010 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 More sharing options...
thescientist Posted April 10, 2010 Share Posted April 10, 2010 it definitely sounds like what you need to learn/implement is classes, like DD suggested. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.