# main-require

> Ensures that an HTML document contains a `<main>` element within the `<body>` tag for proper document structure and accessibility.

A `<main>` element is required within the `<body>` tag of HTML documents.

Level: Warning

## Config value

[Section titled “Config value”](#config-value)

* `true`: enable rule
* `false`: disable rule

### The following patterns are **not** considered rule violations

[Section titled “The following patterns are not considered rule violations”](#the-following-patterns-are-not-considered-rule-violations)

```html
<html><body><main>Content</main></body></html>
```

```html
<html><body><header>Header</header><main>Content</main><footer>Footer</footer></body></html>
```

### The following patterns are considered rule violations

[Section titled “The following patterns are considered rule violations”](#the-following-patterns-are-considered-rule-violations)

```html
<html><body><p>No main tag</p></body></html>
```

```html
<html><body><header>Header</header><footer>Footer</footer></body></html>
```

### Why this rule is important

[Section titled “Why this rule is important”](#why-this-rule-is-important)

This rule ensures that the document has a clear and accessible structure, which is important for both users and screen readers.

Further reading: [Axe Rules - landmark-one-main](https://dequeuniversity.com/rules/axe/4.9/landmark-one-main)