Dogoku Dogoku - 1 year ago 65
HTML Question

Is it semantically correct to use <h1> in a dialog?

I've gone through the code for The Incredible Accesible Dialog v3 and i have noticed that they are using an


<div id="modal" aria-hidden="false" aria-labelledby="modalTitle" aria-describedby="modalDescription" role="dialog">
<div id="modalDescription" class="screen-reader-offscreen">...</div>
<h1 id="modalTitle">...</h1>
<form name="form1" onsubmit="return false;">...</form>

So that got me thinking, is that actually semantically correct? I mean everyone keeps saying there should only be 1
in a document.

Note that in previous versions of the dialog, they gave the dialog a
which makes using
ok imho

Answer Source

Semantically, you can start any new section of the document (section, article, nav, aside, header, footer) with an h1.

But a dialog is not a new section, although you can perfectly include it in a different section.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download