Skip to main content

HTML Guide

Free site validation

Find out what web pages on your sites are affected by HTML issues.

A document must not include more than one visible “main” element.

There can only be one visible <main> element in a document. If more are needed (for example for switching between them with JavaScript), only one can be visible, the others should be hidden toggling the hidden attribute.

Example of 2 main elements, where only one is visible:

  <h1>Active main element</h1>
  <!-- content -->

<main hidden>
  <h1>Hidden main element</h1>
  <!-- content -->

Learn more:

Related W3C validator issues