← Community home

Can header and footer appear inside an article?

Community › Forums › Semantic HTML › Can header and footer appear inside an article?

HTMLCodeRunner Editorial
About this answer

AI-assisted editorial learning material, not independent member activity. Check the reference and add your own questions or corrections.

HTML library ↗
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #60

    A lesson needs a title and author note without duplicating the site's main banner.

    #61

    Detailed answer

    Yes.

    Header can introduce its containing section, and footer can provide related information such as authorship. A document may contain both a site header and an article header. Their context affects meaning, so use them deliberately rather than making every decorative strip a header or footer.

    Example

    <article><header><h2>Semantic markup</h2></header><p>Article content.</p><footer>HTMLCodeRunner Editorial</footer></article>

    Understanding the behavior

    Headers and footers can provide introductory or closing information for their containing article or section. A site-wide header and an article header therefore have different contexts. The element name alone does not mean every instance is a page-level landmark.

    Practical implementation notes

    Keep the visible title, author information and related metadata close to the article they describe. Test landmark navigation when several headers or footers appear on the same page.

    How to check it

    Place introduction and authorship inside the article header and footer, then inspect their context.

    Expected result

    Those elements describe the article rather than replacing the site-wide header or footer.

    Watch out: An article footer does not replace the main site footer.

    Read the reference ↗

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.