View Single Post
Old 08-07-2013, 11:23 AM   #13
ibu
Addict
ibu can eat soup with a fork.ibu can eat soup with a fork.ibu can eat soup with a fork.ibu can eat soup with a fork.ibu can eat soup with a fork.ibu can eat soup with a fork.ibu can eat soup with a fork.ibu can eat soup with a fork.ibu can eat soup with a fork.ibu can eat soup with a fork.ibu can eat soup with a fork.
 
Posts: 264
Karma: 9246
Join Date: Feb 2010
Location: Berlin, Germany
Device: Kobo H20, iPhone 6+, Macbook Pro
@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>
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.

@Agame

OK, some example for bad markup:

Code:
<p class="h1"><samp>...</samp></p>

<h2 class="h2" id="heading_id_2">...</h2>

<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.

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.

Last edited by ibu; 08-07-2013 at 12:14 PM.
ibu is offline   Reply With Quote