HTML HTML Tutorial HTML Forms HTML Graphics HTML Media HTML APIs HTML Tags



HTML Tag: main

The HTML Tag: main is a semantic tag that is used to define the main content of a web page. It is used to identify the primary content of a web page and is typically used only once per page. The main tag is used to improve the accessibility and search engine optimization of a web page by providing a clear indication of the primary content of the page.

The HTML Tag: main is a relatively new addition to the HTML5 specification. It was introduced to provide a clear and concise way to identify the primary content of a web page. The main tag is used to wrap the main content of a web page, such as the main article, blog post, or product description. By using the main tag, web developers can improve the accessibility and search engine optimization of their web pages.

The main tag is also useful for screen readers and other assistive technologies. By identifying the primary content of a web page, screen readers can provide a more accurate and meaningful description of the page to visually impaired users. This can help to improve the overall user experience and make the web more accessible to everyone.

Here are some examples of how to use the HTML Tag: main:

Example 1:

<main>
This is the main content of the web page.
</main>

Example 2:

<main>
<article>
This is the main article of the web page.
</article>
</main>

Example 3:

<main>
<section>
This is the main section of the web page.
</section>
</main>

Activity