# html/html-validate

> Validates HTML files for nesting, required attributes, text alternatives, and one style for void elements.

Validates HTML files for nesting, required attributes, text alternatives, and one style for void elements.

Part of the [`html`](/reference/configurations/html/) configuration, at the `recommended` [level](/start/concepts/#levels). It runs at the `commit` [stage](/start/concepts/#stage), per file. It runs html-validate.

## Why

Each browser repairs broken markup differently, and a screen reader announces only what remains.

## What to do

Change the markup the way the rule page says. Turn one rule off with `gspot ignore html/html-validate --rule <name> --reason "<why>"`.

## Example

An `<img src="logo.png">` without alternative text reports a finding. Add `alt` text, or leave it empty for a decorative image.

## Turn it off

Turn it off for some files, or one of its lint rules, with a reason:

```shell
gspot ignore html/html-validate --paths "<glob>" --reason "<why>"
gspot ignore html/html-validate --rule <rule> --reason "<why>"
```

To silence one place, write a comment such as:

```text
<!-- [html-validate-disable-next no-inline-style -- the email client strips classes] -->
```
