View Single Post
Old 10-28-2015, 02:58 PM   #72
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,363
Karma: 20212733
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
strong and em tags have intrinsic formatting, which is what they are usually used for. They always do something.

And I've never seen the point of them anyway -- you should be using b and i, they're shorter.

If you want to style them so they work differently, well, you can do some pretty crazy stuff with CSS, and mostly ignore what tags are "supposed to" do.

But span is a no-op. It has no structural meaning, and no fundamental styling quirks.
All it does is redefines an arbitrary chunk of characters (allowing you to slap a label on it), unlike every other tag.
Redefining the default nature of a tag is something to be done with deliberation.
Not to belabor the point...but I'm bored...


According to W3Schools - The Span element:

Quote:
The <span> tag is used to group inline-elements in a document.
The <span> tag provides no visual change by itself.
The <span> tag provides a way to add a hook to a part of a text or a part of a document.
"Grouping inline-elements" certainly seems to mean "structural". As you pointed out - and I agree with - without css the tag provides no formatting by itself but provides a way to hook to that part of the text...it's not required to use a "class", "id", or "name" to provide the "hook".



The EM tag:

Quote:
The <em> tag is a phrase tag. It renders as emphasized text.
Tip: This tag is not deprecated, but it is possible to achieve richer effect with CSS.
...
Most browsers [not all] will display the <em> element with the following default values: em {font-style: italic;} [notice no class required]
(emphasis mine)

While most browsers and readers will display using the default value - italic - it is not 100% guaranteed and one SHOULD define what they want via css.
Other "phrase tags" are: strong, code, samp, kbd, and var, which may have different levels of default styling/support.


As for the <b> and <i> tags...

Quote:
Note: According to the HTML 5 specification, the <b> tag should be used as a LAST resort when no other tag is more appropriate. The HTML 5 specification states that headings should be denoted with the <h1> to <h6> tags, emphasized text should be denoted with the <em> tag, important text should be denoted with the <strong> tag, and marked/highlighted text should use the <mark> tag.
(emphasis mine)

This makes clear the intent to differentiate between <em> structurally emphasized text and styled <i> italic text. Tell me how a device that is reading aloud your book will present text with an <i> tag...which is a visual styling?? If you define it as <em> emphasized then the device could give more stress to the word with more volume, or whatever you decide in the css.

Quote:
Originally Posted by eschwartz View Post
The reason I suggested matching on "small" wasn't because there is a tag like that. It's because if you are going to use a span, use a span class="small"
Classes rule. "but <span> is 20% shorter" is an excuse.

You can probably get away with it, though. Just pointing out that when you say "but it's shorter" you are quite obviously valuing short and quick over meticulous devotion to correctness.
Well, I was trying to be a little amusing with the 20% shorter...thus the winky Not making an excuse but yes, I am probably a little OCD-ish with trying to make my code as concise and compact as possible... Why have class designators when they are unneeded and/or unnecessary? I could easily put
<h2>Chapter One <span class="Rumpelstiltskin-has-a-wart-on-his-nose class-overide-chapter-title-name">Wut?</span></h2>

But this is so much more elegant, does the exact same thing, validates, follows the rules, etc.
<h2>Chapter One <span>Wut?</span></h2>

When I clean up a book, I am able to get it to look just like the original, but at usually half (or less) the original file size. A big chunk of that savings is cutting out unnecessary spans, divs, styles, and classes that are repeated multiple times in a book. I had one 5MB book that I got down to about 600KB!! Don't authors get charged more if their file size is too large?? It seems authors would naturally wish to keep file size down.

OK...time for me to actually get something done around here...
Cheers!
Turtle91 is offline   Reply With Quote