Main
The HTML main element identifies the dominant content of a document or application view, excluding shared navigation and peripheral content.
Build a Website with ChatGPT
A main element is an HTML element that identifies the principal content of a document.
- How it is used
- Identifies the unique content of a page within layouts that may also have a repeating header, navigation, and footer.
- How deep it goes
- Defines placement and the one-per-page rule, then demonstrates content and layouts; does not explore browser internals.
- Examples
- Uses book club sections, expandable journal entries, and a two-column article with a sidebar as page-specific content.
- What you can do after
- Apply it via ChatGPT prompts to generate a page whose main element contains specified content or an article layout.
Web Design Playground, Second Edition
Main content is the primary subject matter of a web page, excluding shared navigation and peripheral regions.
- How it is used
- Marks the content unique to a page, separate from commonly shared header, navigation, aside, and footer areas.
- How deep it goes
- Defines the element, states its one-per-page rule, and shows placement and project uses without detailing assistive-technology behavior.
- Examples
- Shows a page skeleton, a thumbnail photo gallery, and a portfolio divided into sections.
- What you can do after
- Build it from scratch by placing one `<main>` around page-specific content and adding sections or gallery images inside it.
Read how Web Design Playground, Second Edition explains main →
Acing the Frontend Interview
The HTML main element represents the dominant content of a document.
- How it is used
- Uses <main> to mark dominant document content within a semantic HTML hierarchy.
- How deep it goes
- Explains semantic purpose and demonstrates nested JSX, but does not detail browser or accessibility-technology internals.
- Examples
- Demonstrates a favorite-article React page whose <main> contains an article, header, mapped sections, subsection headings, and paragraphs.
- What you can do after
- Build it from scratch in JSX by structuring article content with <main> and related semantic elements.
Web Design Playground
The primary content area of a page that carries the central information or purpose of the page.
- How it is used
- Marks the current page’s unique central content and provides a container for page-specific layouts.
- How deep it goes
- Defines semantic placement, nesting, and flexbox behavior, while stopping short of deeper accessibility guidance.
- Examples
- Uses personal-page text, article-and-sidebar layouts, and photo galleries containing linked, wrapping thumbnails.
- What you can do after
- Build it from scratch by placing unique content in <main> and arranging its regions with semantic HTML and flexbox.
Also covered in
- Design for Developers
- Vanilla WebIn early access (MEAP)
What to know first
- CSSCSS (Cascading Style Sheets) is a stylesheet language for specifying the presentation and layout of structured documents.
- footer sectionA footer is a region associated with a document or section that contains closing or supplementary content, often positioned at the bottom.
- HTMLHTML is the standard markup language for structuring content and elements in documents on the web.
- body elementThe HTML body element contains the content of a document intended for display in a browser.
Related concepts
- article elementhas part · The HTML article element represents a self-contained composition that can stand independently or be distributed or reused.
- HTMLpart of · HTML is the standard markup language for structuring content and elements in documents on the web.
- blogpart of · A blog is a regularly updated website or online publication containing dated or organized posts, articles, or multimedia entries.
- flex-growconfigured by · The CSS flex-grow property specifies a nonnegative factor determining a flex item’s proportional share of available free space.
- home pagepart of · A home page is a website’s primary or default introductory page and an entry point to its main content or sections.
- introductionhas part · An introduction is an opening section or explanation that presents a subject, purpose, scope, or entity and prepares an audience for what follows.
Questions about main
What is main?
The HTML main element identifies the dominant content of a document or application view, excluding shared navigation and peripheral content.
Which Manning books explain main?
Build a Website with ChatGPT, Web Design Playground, Second Edition, Acing the Frontend Interview and Web Design Playground.
What should I know before learning main?
Manning books that teach main usually introduce CSS, footer section, HTML and body element first.
What is main part of?
Main is part of HTML. HTML is the standard markup language for structuring content and elements in documents on the web.
What are the parts of main?
Main includes article element and introduction.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.



