# html-lang-require

> Requires the lang attribute on the <html> element to ensure proper language declaration for accessibility and SEO.

The lang attribute of an `<html>` element must be present and should be valid.

Level: Warning

## Config value

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

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

### The following pattern is **not** considered rule violations

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

```html
<html lang="en"></html>
```

### The following patterns are considered a rule violations

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

```html
<!-- missing lang tag -->
<html></html>
```

```html
<!-- empty lang tag -->
<html lang=""></html>
```

```html
<!-- invalid BCP 47 lang value -->
<html lang="-"></html>
```

### Why this rule is important

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

The lang attribute is used to declare the language of the document, which helps with SEO and accessibility.