HTML Tutorial
<main>
tag?The <main>
tag represents the primary content of a web page, excluding navigation, sidebars, and other auxiliary content.
<main>
:<main>
tag after the <body>
tag and before any other content sections.<main>
tag.<main>
:<main>
:<body>
<main>
<h1>Welcome!</h1>
<p>This is the main content of the page.</p>
</main>
</body>
<body>
<nav>...</nav>
<main id="content">
<h1>Title</h1>
<p>Content...</p>
</main>
<aside>...</aside>
</body>
Exploring the <main>
tag:
<body>
and <main>
tags as shown in the examples above.<main>
tag.The <main>
tag helps assistive technologies, such as screen readers, easily identify the most important content on a page. By using the role="main" attribute, you can improve the accessibility of your web page for users with disabilities.