liveBook · Manning

Header element

As explained in Build a Website with ChatGPT

The header element is an HTML element representing introductory content for a page or section.

A header element defines the introductory area of a web page. It usually sits at the top of the page and commonly contains a logo or icon, a page or site title, and an optional tagline. A header often spans the page width, while the page content itself can remain narrower for easier reading. section 4.2.1

Mark header content by placing it between opening <header> and closing </header> tags. Add a heading for the title, a paragraph for the tagline, and an image for the logo when needed. A different background color can help visually separate the introduction from the rest of the page. section 4.2.1

A simple site header

This header combines a logo, title, and tagline. In a prompt, name the image file and spell out the exact title and tagline you want generated. section 4.2.1

<header>
    <img src="logo.png" alt="Code & Prose logo">
    <h1>Code & Prose</h1>
    <p>Diving deep into the narrative side of code</p>
</header>

Inspect the opening and closing header tags around a logo image, heading, and tagline. section 4.2.1

Use a header as part of a clear page layout:

  • Place navigation after or alongside the header when visitors need links to other site areas. section 12.2.1
  • Keep page-specific material in the main element; headers, navigation, and footers are often reused across site pages. section 12.2.1
  • Use a footer for closing material such as copyright, contact information, or social links. section 12.2.1
  • Customize header colors, text sizes, logo position, margins, and padding in CSS after generating the initial page. section 4.2.6 section 9.6

Headers adapt to the kind of page: a book club or journal can use a logo, title, and tagline; an information site can add navigation; an interest-site home page can use a hero image; and a course catalog can arrange images, logo, title, and subtitle across the header. section 5.1 section 7.3.2 section 13.5

How Build a Website with ChatGPT covers it

How deep it goes
Defines header markup, typical contents, and basic CSS customization without detailing HTML specifications.
Examples
Demonstrates logo, title, and tagline headers for book clubs, journals, interest sites, galleries, and catalogs.
What it assumes
Starts from no coding knowledge while requiring chosen header content such as a logo, title, and tagline.
What you can do after
Apply it via ChatGPT prompts to generate a page header with specified branding and styling.
How it connects
Connects headers with navigation, main content, footers, headings, paragraphs, images, and CSS.

Also explained in

Compare how 2 books explain header element →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Build a Website with ChatGPT. The section links point to the parts of the book it draws on.