Publish in HTML Tutorial el 24/05/2025 16:49
The <main> element represents the dominant content of the <body> of a document. It should contain content that is unique to that document and not repeated across multiple pages (like navigation links, headers, or footers).
Key characteristics of <main>:
Here's how the <main> element is structured in HTML:
A simple page structure with <main> containing the primary content.
<main> can contain <article> elements for blog posts or news items.
Using JavaScript to dynamically update content within the <main> element.
A contact form placed within the <main> element.
Using JavaScript to create a tabbed interface within the <main> element.
main { /* styles */ }
.The <main> element is supported in all modern browsers, including:
For older browsers, you can add the following CSS to ensure proper display:
The <style> HTML element contains style information for a document, or part of a document. ...
The <strong> element is used to indicate that its content has strong importance, seriousnes...
The <span> element is an inline container used to mark up a part of a text or document. Unl...
The <source> element is used to specify multiple media resources for media elements like &l...
The <small> element is used to represent side-comments and small print, typically for discl...
HTML <section> Element: The Complete Guide The <section> element is a semantic HTML ...