Use case is a blog post:
<article>
element is used inside<main>
, to encase an article on a post page.<header>
is in use within<article>
, containing<h1>
title and meta including author, datestamp etc.
<article class="card bg-white">
<header>
<div class="card-img-top p-0">
<a href="image.jpg" title="Article title"><img width="1414" height="1011" src="image.jpg 1200w" sizes="(max-width: 1414px) 100vw, 1414px"></a>
</div>
<h1 class="entry-title" itemprop="headline">
<a href="article-url" title="Article title" rel="bookmark">Article title</a>
</h1>
<div class="entry-meta">
<span class="author vcard" itemprop="author" itemscope="" itemtype="https://schema.org/Person"><span itemprop="name"><a href="/author/joe-bloggs" title="Posts by Joe Bloggs" rel="author">Joe Bloggs</a></span></span>
<span class="meta-sep"> | </span>
<time class="entry-date" datetime="2022-03-14T14:28:33+00:00" title="March 14, 2022, 2:28 pm" itemprop="datePublished">14 March 2022</time>
<meta itemprop="dateModified" content="14 March 2022">
</div>
</header>
<div class="entry-content" itemprop="mainEntityOfPage">
<meta itemprop="description" content="Excerpt for article">
<p>Article text.</p>
<p>Article text.</p>
<p>Article text.</p>
</div>
</article>
Each post has a feature image. Does this image belong semantically to <header>
, or does it not matter (ie. anywhere in <article>
)?
I wish to present the image above the meta info, ie. the existing <header>
. Visually, I guess it would sort of comprise the header area (ie. the stuff before the post body), but it would not necessarily communicate meta information about the post. If the lead image should not be part of <header>
, this would mean it is also above <header>
.
(Despite presence of a <header>
at top of page, multiple in-page <header>
s are permitted where semantically justified).
However, found documentation tends to pertain to the top-of-page header use of <header>
alone:
The
<header>
element represents a container for introductory content or a set of navigational links.A
<header>
element typically contains:
- one or more heading elements (
<h1>
-<h6>
)- logo or icon
- authorship