Are there some noticeable outcomes in terms of performance or other aspects to follow semantic HTML?
Thanks
What are the main benefits of semantic search? The semantic search engine knows the different ways a concept can be expressed and in what context a term is used. It uses this knowledge to help you find more relevant candidates faster.
Semantic code uses html elements for their given purpose. Well structured HTML will have semantic meaning for a wide range of users and user agents (browsers without style sheets, text browsers, PDAs, search engines etc.) The two points mentioned earlier are the basic benefits of using semantic code.
Semantic HTML is the correct use of HTML to reinforce the meaning of content on a web page, rather than merely define its appearance. Semantically correct HTML helps search engines, screen readers, and other user devices determine the significance and context of web content.
Using semantic markup results in very clear, standardized code, and that means you'll save time in the long run. Clear code is more easily maintained. It also means that a different developer could come in and work with the code without confusion, since the code is organized in a logical way.
Semantic markup isn't about performance, it's about meaning.
Let's imagine two parallel universes.
<thing>
. How would you specify where styles should be applied? How would browsers know how to render the page? How would screen readers for the blind differentiate between headlines and text and footnotes and menu items? You'd have to add all kinds of awkward attributes.<header>
and <footer>
and <article>
and <caption>
and <menu>
and <paragraph>
and <footnote>
, etc. Now a user agent (a browser or screen reader) can make reasonable assumptions about how to style those, or make them interactive, or read them aloud. For example, a browser will make <button>
s look clickable and will enable moving between them with the tab key, whereas if you use a <div class="button">
, it won't know to do that. A screen reader might give more priority to reading the <p>
s than the <aside>
s.If you want to override the user agent's default treatment of an element, or if a user agent is set to do so, it's easier to target specific kinds of content. For example:
The real world is somewhere between these two scenarios.
Some aspects of semantic HTML are a bit idealistic, but the principle is sound. For example, using <strong>
instead of <b>
conveys "this text is important" and not necessarily "this text should be bold." Maybe your user wants important text to be highlighted orange. That's up to them.
The point is, HTML is markup, which is about labeling things usefully. Semantic HTML is what all HTML should be: useful, meaningful labels.
Making your site load quickly is a different question altogether.
(See also: my answer here.)
I think it's natural for HTML to become more semantic over time.
Back in Dumb HTML world, they'd probably end up with crazy markup, like <thing type='list'>
, and <thing render='image'>
. Web coders would complain, "hey, we do this all the time. Why not just have an <image>
tag? It would make our lives easier."
In the real world, people are constantly coding things like <div id='nav'>
and <div class='article'>
. So it makes sense to create new elements, like <nav>
and <article>
and <section>
. Which is what the draft HTML5 specs would do.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With