HTML heading tags should be used in a way that maintains semantic structure (for both SEO and accessibility). Generally this means a single <h1>
for the current page heading, with lesser headings nested from there.
However dialogs are often created dynamically, meaning that their html is added at the end of the <body>
. In these cases it seems that any dialog heading numbering should start with <h1>
, as their html lives outside of any existing heading structure.
To give a practical example:
<h1>
titleShould this dialog use an <h1>
heading, even though semantically it belongs within the existing "My Profile" <h1>
?
Using an H1 for the dialog title is definitely a good idea.
With the hope that these three points convainced you that you have everything to win and absolutely nothing to lose to put the dialog title in a H1.