View Single Post
Old 12-24-2013, 12:03 PM   #102
stevelitt
Member
stevelitt began at the beginning.
 
Posts: 13
Karma: 24
Join Date: Dec 2013
Location: Florida, USA
Device: Kindle
Quote:
Originally Posted by Hitch View Post
Steve:

There's nothing "wrong" with divs or spans used where appropriate. What we were all discussing here is the sloppy use of them in lieu of more appropriate coding, for example, an inline style div instead of using em or strong, or bold or italic. Most epubs ought to have as much of the styling defined in the CSS as possible, as opposed to inline, on the fly styles.

For example, I stupidly (I've told this story here before) once agreed to take on and "fix" an ePUB that was purportedly completed, to rebuild into a MOBI. Some 66 spans later, named sequentially, "char-override style 1" through "char-override-style-66," I regretted it enormously. Or spans to achieve a font size (e.g., font-size 80%, or some such) instead of a named class. Once someone gets in the habit of "on the fly" styling spans, it's really no different than the ad hoc styling that we all get to see far too often from ill-created Word files, or worse, the output from something like Adobe Acrobat Pro to an "exported Word file," which is usually pretty catastrophic. ;-)

And yes, divs are for dividing up sections of screen/pages and to contain other elements. But spans tend to be the output children of programs that are intended for print, and thus, make for sloppier, less discernible coding. That's all.

Hitch
Thanks Hitch,

First, I meant to interleave-post, discussing each of your points below where you made it in your quoted text, but I didn't know how. If someone can tell me how, I'll do that next time. And now back to the topic...

Now I understand. I use span and div to define styles that assign an appearance to text and paragraphs of a specific purpose. Ibu's point was that some people, and some brain-dead converters, use them to fingerpaint appearances directly to text, with no context as to the text's purpose.

As an aside, I think that what Ibu called "high quality semantic html" is similar to what I call "Styles Based Authoring", meaning that no appearance is ever applied directly to text: The only thing applied to text is a style with a one to one correspondence to the purpose of the text (p.author, div.appendix, but not p.rightjust). Personally, I use h1, h2, h3 for Part, Chapter, Section. I think that was always the intent of the h? tags.

I have several pro-styles-based arguments in my new ePub construction tutorial at http://www.troubleshooters.com/ebook..._demystify.htm .

I feel your pain on that fingerpainted Xhtml with 66 spans. I'm a big fan of LyX, but by the time I massage LyX's Xhtml output to make it sane for ePub, I'm ready to spend some time in a mental hospitial. And the blame isn't entirely that of the converters: If the document's author fingerpainted his source doc, whether it was MS Word, LibreOffice, LyX, Bluefish authored Xhtml, Docbook, or something else, then it's going to mess up the ePub, or else your appearances will disappear.

In my new tutorial, several places I urge the reader never to apply an appearance directly to text, and never to make a style whose sole purpose is an appearance, and never to name a style after an appearance. From my perspective, if the source doc is styles-based, all you need is to write a program to page-break appropriately while ring-tossing pages into the Manifest, Spine, Guide, and NCX file, and then make sure every style has appropriate an CSS style. Yeah, that's an oversimplification, but you know what I mean.

Thanks for the clarification.

SteveT
stevelitt is offline   Reply With Quote