# Media

Source: https://iriscss.com/documentation/elements/media/

Images, video, audio, iframes and SVG scale down to fit their container.

## Images

Images never grow wider than their container and keep their aspect ratio. The alt text of an image that fails to load shows in italics.

```html
<img src="/android-chrome-512x512.png" alt="Iris CSS logo" width="160" height="160">
<img src="/missing.png" alt="This image failed to load">
```

## Figure

A `figcaption` sits under the media in the subtle text color.

```html
<figure>
  <img src="/android-chrome-512x512.png" alt="Iris CSS logo" width="120" height="120">
  <figcaption>The Iris CSS logo.</figcaption>
</figure>
```

## Iframe

An iframe without `width` or `height` fills the width at 16:9. Embedded videos need no wrapper.

```html
<iframe src="/about/" title="About Iris CSS"></iframe>
```

## Audio and video

`audio` fills the width. `video` scales like an image, and captions from a `track` use the page font.

```html
<audio controls src="podcast.mp3"></audio>

<video controls width="640" height="360" src="intro.mp4">
  <track kind="captions" src="intro.vtt" srclang="en" label="English">
</video>
```

## SVG

An inline SVG without a `fill` takes the text color.

```html
<p class="brand">
  <svg viewBox="0 0 16 16" width="24" height="24" aria-hidden="true"><path d="M8 0l2.5 5 5.5.8-4 3.9.9 5.5L8 12.6 3.1 15.2 4 9.7 0 5.8 5.5 5z"/></svg>
  A star in the text color
</p>
```

## Variables

| Variable | Default | Note |
| --- | --- | --- |
| `--i-cue-color-text` | `var(--i-color-white)` | Video captions |
| `--i-cue-color-background` | `#000c` |  |
