html5 - Is legend in header valid ? <h1><legend> Caption </legend></h1> -
i know if insert legend inside header. way legend can have hierarchy related whole document.
i have more text below relevant needs highlighted readers. in case personal information legend
, h2
@ same time. h1
element in site chose not display.
<fieldset> <h2> <legend>personal information</legend> </h2> <h3> credentials </h3> <label for="username"> username </label> <input id="username" type="text"> <label for="surname"> surname </label> <input id="surname" type="text"> <h3> contact details </h3> <label for="street"> street </label> <input id="street" type="text"> <label for="house-number"> house number </label> <input id="house-number" type="number"> </fieldset>
as stated in https://developer.mozilla.org/it/docs/web/html/element/legend
permitted parent elements:
<fieldset>
first child<legend>
element
in example <legend>
element not first child of ancestor <fieldset>
, not valid html5 markup.
furthermore note reverting order of elements so
<legend><h2>personal information</h2></legend>
the markup not still valid, since <legend>
allows phrasing content only
Comments
Post a Comment