# `Bylaw.HTML.Check.RequireImageAlt`
[🔗](https://github.com/ryanzidago/bylaw/blob/v0.1.0-alpha.2/lib/bylaw/html/check/require_image_alt.ex#L1)

Validates that rendered image tags define an `alt` attribute.

This check inspects rendered `<img>` elements and flags images without `alt`.
Use `alt=""` for decorative images.

## Examples

Bad:

    <img src="/logo.svg">

Why this is bad:

An image without `alt` has no explicit accessible text alternative. Screen
readers may announce the file path or omit useful content.

Better:

    <img src="/logo.svg" alt="Company logo">

Why this is better:

The image has an accessible text alternative.

Bad:

    <img src="/spacer.svg">

Why this is bad:

Decorative images should be intentionally hidden from assistive technology
rather than left ambiguous.

Better:

    <img src="/spacer.svg" alt="">

Why this is better:

Empty `alt` communicates that the image is decorative.

## Notes

The check only verifies that an `alt` attribute is present. It allows
`alt=""` because empty alt text is the expected markup for decorative images.
It does not judge whether non-empty alt text is descriptive enough.

This check runs on rendered HTML, so dynamic `alt` attributes are evaluated
after rendering.

## Options

This check has no check-specific options. Add the module directly to the
explicit checks list:

    Bylaw.HTML.Check.RequireImageAlt

## Usage

Add this module to the explicit check list passed through `Bylaw.HTML`.
See `Bylaw.HTML` for the full rendered HTML validation setup.

# `validate`

```elixir
@spec validate(Bylaw.HTML.Check.context()) :: Bylaw.HTML.Check.result()
```

Implements the `Bylaw.HTML.Check` validation callback.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
