Thread: Mysterious html
View Single Post
Old 04-16-2012, 01:24 AM   #15
ATDrake
Wizzard
ATDrake ought to be getting tired of karma fortunes by now.ATDrake ought to be getting tired of karma fortunes by now.ATDrake ought to be getting tired of karma fortunes by now.ATDrake ought to be getting tired of karma fortunes by now.ATDrake ought to be getting tired of karma fortunes by now.ATDrake ought to be getting tired of karma fortunes by now.ATDrake ought to be getting tired of karma fortunes by now.ATDrake ought to be getting tired of karma fortunes by now.ATDrake ought to be getting tired of karma fortunes by now.ATDrake ought to be getting tired of karma fortunes by now.ATDrake ought to be getting tired of karma fortunes by now.
 
Posts: 11,517
Karma: 33048258
Join Date: Mar 2010
Location: Roundworld
Device: Kindle 2 International, Sony PRS-T1, BlackBerry PlayBook, Acer Iconia
1. The span is total cruft, probably left behind by some messy word processor auto-html. Feel free to get rid of it. Spans are only ever important in an e-book if they have a class as a hook for some sort of CSS formatting or a lang attribute to denote a foreign language phrase you might want to format differently to make it stand out.

2. That particular div looks superfluous, especially with a height of 0 em and nothing inside. If a div has nothing inside, assume it's cruft and delete.

Only if it's got a height set might you possibly want to keep it in case it's some sort of important scene spacer, but you can get a much better effect by wrapping a new div around the entire "spaced" section and giving it a class hook to anchor some CSS formatting to get the linespacing effect (or just put in a manual spacer like an <hr /> line).

You wouldn't need a <p> with height set to 0, because the default for Mobi display on e-ink Kindles (may be different on K4apps and other readers) is for no spacing between lines by default anyway. However, you could wrap the <a> within a <p> and omit the <br /> as you'd get a line-break with the <p> anyway and that would allow you to style the formatting later in case you decide you do want some space between lines or you want no-indent in the TOC entries (the functional part of the hypothetical <p width="0">).

3. That <a> is actually functional and pretty important, as it acts as a link to wherever Chapter 3 is located. You need to keep that one. But you can get rid of the font tags. You can't even see colours in most Mobi-supporting devices anyway (maybe K4PC/iDevice apps).

All you really need to look at in an HTML tutorial is what the "presentational attributes" possible for a given HTML tag are, because that's all you'll be able to use with Mobi, and you'll only be able to use a small subset of them (eg. anything involving setting a colour, you can ignore).

Hope this helps.
ATDrake is offline   Reply With Quote