Quote:
Originally Posted by pdurrant
No idea. <h#> tags don't actually mean anything, although some sofwtare will treat them in special ways (e.g. to automatically generate a table of contents). there's nothing that can be done with a <h#> tage that can't be done with a styled <p> or even <div> tag.
|
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.