<header>: The HTML Header Element

1 Description

The HTML <header> element is used as a container for the information and elements which are at the top of the webpage or section element. Things like a company logo, login button navigation links, or a search form.

The <header> element may also be used inside a <section> type element to contain a title, or other information meant to introduce a reader to the content contained in the section.

See also the following elements

  1. <main>
  2. <footer>
  3. <head>

2 Examples

<!DOCTYPE html>
<html>
    <head>
        <title>Example Page</title>
    </head>
    <body>
        <header>
            <a title="logo" href="/">Rowland Industries</a>
            <a title="login to your account" href="/account/login">Login</a>
        </header>
        <main>
            <h1>Weather Forecast for Miami Florida</h1>
            <h2>March 19th, 2025</h2>
            <section>
                <h3>Morning</h3>
                <p>
                    The morning is expected to be overcast, warm, and humid.
                    The lowest temperature expected is 50 degrees Fahrenheit,
                    warming to 77 degrees Fahrenheit by 11:00AM.
                </p>
            </section>
            <section>
                <h3>Afternoon</h3>
                <p>
                    The afternoon is expected to be clear, humid, and sunny with
                    a high of 81 degrees Fahrenheit and with NNW at 9 to 11 mph.
                </p>
            </section>
            <section>
                <h3>Evening/Night</h3>
                <p>
                    In the evening it will be cool and breezy with winds picking
                    up to around 10 to 15 mph and traveling NW. Clouds will be
                    scattered and the overnight low will be 51 degrees Fahrenheit.
                </p>
            </section>
        </main>
        <footer>
            <p>Copyright 2025 Rowland Industries LLC, All Rights Reserved.</p>
        </footer>
    </body>
</html>

This document was last updated: