View Single Post
Old 10-28-2015, 11:28 AM   #69
Turtle91
A Hairy Wizard
Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.
 
Turtle91's Avatar
 
Posts: 3,355
Karma: 20171571
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 15/11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
Quote:
Originally Posted by eschwartz View Post
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. )
wow...I have ugly code too...

I've seen <small> used like that but <span> is 20% shorter and <big> isn't supported in HTML5 . I use it for all kinds of specific formatting inside another tag. It was just coincidence that my example had a smaller font size.

I didn't realize <span>s were designed specifically/solely as a class selector. I thought classes could be applied to any element and that spans were simply to structurally differentiate a... well... span of characters. Not unlike the <em> tag which allows you to identify some text as emphasized. Then 'emphasize' it however you want using css and/or define them using different classes. Some people are even happy with no classes and relying on the default for most readers (simple italics).

I completely understand the uselessness of nested empty spans and/or those with no corresponding css.

Quote:
Originally Posted by eschwartz View Post
And it saves you from falling prey to heuristics.

But no one said you have to use the plugin either.
Perhaps adjusting the heuristics of the plugin to check <span>s for corresponding css...if found=don't delete... would be better?? Otherwise, for consistency, you could also delete all empty <em> tags...
Turtle91 is offline   Reply With Quote