Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Simply use <strong> or <em> to let the browser know that your heading is important.


I'm not sure if this is supposed to be a joke, or...?


Not a joke at all.

It should look like:

<header>

    <h1>My page title</h1>

    <strong>My page is the best page on this website.</strong>
<header>

If your heading is a paragraph you should use a <p> instead.

That's what we have been doing for ages. I don't see the need for a new tag. HTML5 already add semantic tags. Before, it would have been the same as this snipped I posted but without the <header> tag. Now that this tag exists there is no confusion at all. Web crawlers should be smart enough to know that the <strong> that that is in a header right next to a title is a heading.

Hell, even <hgroup> has been deprecated because we don't need those tags.


But what does that have to do with the original article? The problem it's discussing is the lack of a context-dependent outline algorithm for h1-6 elements in modern browsers.


It already does that. If you do :

<body>

<h1>My website</h1>

<section>

    <h1>My section</h1>
</section

</body>

The second <h1> will act as a <h2>.

Edit: I think I'm missing the point here. Ignore those posts.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: