View Single Post
Old 06-08-2020, 12:15 PM   #24
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 79,929
Karma: 146918083
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by Mister L View Post
I'm not sure that's a good way to put it. It's completely true that you can style a p or a div tag to look like a heading and to the reader there will be no difference. However the h tags have a semantic meaning (h = "heading" and the numbers 1-6 allow you to create a hierarchy with titles, subtitles etc.) which is useful for creating the toc in Sigil but also can be very important for other reasons, for example for accessibility (e.g. screen readers for blind people). If a reader turns off the css styles, h tags will still be displayed with default html styling that makes it clear they are headings and not just a paragraph of body text.

Semantically correct tags should always be used for their semantic value rather than for their appearance, and should never be mimicked on default tags (p, div) with css when the default tags are insufficiently specific.
I agree that the correct tags should be used. But if you don't go int the code to have a look, would you know the difference between <p class="chapter"> or <h2 class="chapter">? I wouldn't know the difference. When I clean up eBooks, I do leave the chapter header with the <p that the publisher put in. All I do is fix the class. If I was needing to generate a new ToC, <p would be replaced with <h2. But I don't know of any case (once the ePub is made) where there is any noticeable difference between <p and <h2 with the chapter class.
JSWolf is offline   Reply With Quote