View Single Post
Old 08-07-2013, 04:54 PM   #19
Agama
Guru
Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.
 
Agama's Avatar
 
Posts: 776
Karma: 2751519
Join Date: Jul 2010
Location: UK
Device: PW2, Nexus7
Quote:
Originally Posted by ibu View Post
@Jellby
Well, to be honest I don't want to go to deep into a general discussion on "what is the best markup".

But because two of you asked, of course I answer in short to that.

Sure there are markup situation, where a span/div is appropriate.

Because there's no specific element for "number" and if you really need to distinguish between the word "chapter" and "the number", than

Code:
<h1>Chapter <span>4</span></h1>
is OK.

Code:
class="number"
is superfluous.

If you need a selektor: "h1 span { }" does the job.

I would prefer another markup.

Code:
<h1>Chapter <em>4</em></h1>
class="number" is not necessarily superfluous because you wlll end up restyling all h1 spans. <em> will emphasise the text but you have no idea that this is the author's intention.

For the best markup you have to ask, what you want to express.

In such a heading the number is the specific part. The word "chapter" is the general part.

For the eye it is importan to recognize the number.
Therefore it's good to emphasize it.

How do you know this? The author may have designed class="number" to de-emphasise numbers.

@Agame

OK, some example for bad markup:

Code:
<p class="h1"><samp>...</samp></p>
Why is this bad?

<h2 class="h2" id="heading_id_2">...</h2>
Why is this bad?

<span class="italic">...</span> (just to emphasized words inside sentences)

<p class="text_noindent_top">...</p> (Neighbor selector can match it)
<p class="text_indent">...</p> (each paragraph has that useless class)
<p class="text_indent">...</p>
The list can be continued endless.

"Semantic" means that, what is declared in the W3C Specs.
To talk about semantic in our context, the semantic must be declared publically and authoritative.

It is. We are using the subset of XHTML associated with the ePub specification.

Only when it's authoritative, producer of interfaces for example blind people can offer a useful output for e.g. headings.

All an author adds with classes or ids it's private joy.

Really? I don't agree. I think that a carefully styled book is easier to read and not just private joy.
Maybe you should convert your books to plain text or markdown and use these on your reader. This would seem to achieve the minimalist approach that you prefer. This could be achieved with existing tools.

I do like my ePubs to be tidy but the external result, (as rendered on a reader), is more important than the internal, (XHTML).
Agama is offline   Reply With Quote