Quote:
Originally Posted by Turtle91
Sometimes I use empty spans to designate a special span inside of another element. There is no reason to give it a special class as long as you define it properly in your css file.
Code:
h2 {font-size:1.2em; text-transform:uppercase}
h2 span {display:block; font-size:.8em; text-transform:none;
font-variant:small-caps}
<h2>Chapter One <span>The Woes of CSS</span></h2>
Always applies the proper formatting to the spanned portion - making a title for the chapter in this case. But it ONLY applies to spans within an h2 tag. It also provides the complete chapter title for Sigil's auto TOC algorithm without having to define title="", and it saves on unnecessary bits & bytes for the file size.
I do agree with you that there are really annoying publishers that go empty span crazy for no reason at all...
Code:
<p class="first-letter-in-a-new-section-of-text text-overide-party-on-dude">
<span><span><span>I</span></span>'d</span> like to say...</p>
CSS:
first-letter-in-a-new-section-of-text {font-size:1em}
text-overide-party-on-dude {}
and then they don't even code for an empty span....
|
Well, you can achieve the same effect in a more specific manner by matching on a class "small" inside of an h2 -- which also tells you or others coming back to the code, what it is supposed to do.

spans weren't
made to provide an extra tag selector for matching CSS. They were made to provide an arbitrary
class selector, and you should use them for what they are meant for.
(Otherwise your code is ugly.

)
And it saves you from falling prey to heuristics.
But no one said you have to use the plugin either.