Header semantic tag only for hx tags?

Like I sometimes saw header is used the whole hero element but sometimes used only for

<header>
<h1>the title</h1>
</header>

Can include p tag?

<header>
<h1>the title</h1>
<p>blablabla</p>
</header>

Or what the logic use the header element? Is not only for hx tags? In default tutorials is used only for that!

Thanks!

I have found it difficult to understand the question but i guess you are trying to ask whether it is okay to enclose <p> tags within <header> tags or any other element for that matter. The <header> element represents a container for introductory content or a set of navigational links and can contain one or more heading elements <h1> - <h6>, logo or icon and authorship information according to W3C. You can read more here: https://www.w3schools.com/tags/tag_header.asp

2 Likes