View Single Post
Old 08-12-2013, 05:09 AM   #69
Jellby
frumious Bandersnatch
Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.
 
Jellby's Avatar
 
Posts: 7,561
Karma: 20150435
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
Quote:
Originally Posted by ibu View Post
I argued carefully in this specific case, why I think it is reasonable to markup the number with em.
The number is, relative to the generic classifier "Chapter", more important.
IMHO.
Well... then something like:

Code:
<h1>Chapter 4
A man called The Oak and his fiancée</h1>
Where you might want (or maybe not) to give a special style to the number, you might want (or maybe not) to force the title to start at a new line, you might want (or maybe not) to have "The Oak" and "fiancée" in italics (for different reasons), and you might want to hide the word "Chapter" completely.

Of course, you can get imaginative with selector rules, but I believe this is clearer, and more flexible:

Code:
<h1><span "name">Chapter</span> <span class="number>4</span>
<span class="title">A man called <em>The Oak</em> and his <span lang="fr">fiancée</span></span></h1>
Code:
span.name { display: none; } /* If you don't want the word "Chapter" */
span.number { font-size: 200%; } /* Extra large chapter number */
span.title { display: block; } /* Title in new line (no hard-coded <br/>) */
:lang(fr) { font-style: italic; } /* Foreign words in italic, normally */
/* (I'm not 100% sure of this syntax now, but it doesn't work in ADE anyway) */
h1 em, h1 :lang(fr) { font-style: normal; } /* No italics in chapter titles, please */
Sometimes spans, divs and classes galore are just a sign of sloppy conversion, but sometimes it's simpler to use them, rather than trying to find convoluted selection rules that might bite you back later.
Jellby is offline   Reply With Quote