Documentation
On this page
Embedded content
Images and other embedded media keep their native browser behavior. Cirth adds only the sizing, alignment, border, and color defaults needed for them to fit consistently into a page.
<figure>
<img src="team.jpg"
width="1200"
height="800"
alt="The support team standing outside the London office">
<figcaption>The support team in London.</figcaption>
</figure>
The width and height attributes give the browser the image's intrinsic
dimensions before the file finishes loading. The browser can reserve the
correct aspect ratio and reduce layout movement. Cirth can still scale the
image down to fit its container.
Native behavior and accessible names #
<img>embeds an image. Use meaningfulalttext when the image conveys information. Usealt=""when it is purely decorative and nearby text already provides everything a reader needs.- Inline
<svg>draws vector content. A meaningful standalone SVG can userole="img"andaria-label, oraria-labelledbypointing to visible or embedded text. Decorative SVG should be hidden from assistive technology. <audio>and<video>use native playback controls when thecontrolsattribute is present. The application supplies captions, transcripts, and alternative content appropriate to the media.<iframe>embeds another page. Give it a concisetitlethat identifies the embedded content, such astitle="Map of the London office".<canvas>is a bitmap drawing surface controlled by script. Provide equivalent fallback content or another accessible representation when the drawing carries information.
ARIA describes content but does not create alternative text, captions, or keyboard interaction. Those remain part of the page's content and application logic.
What Cirth adds #
- Images use
max-width: 100%, so a large file scales down instead of overflowing its container. - When both dimension attributes are present,
height: autopreserves the image's aspect ratio while it scales. A height-only image keeps that explicit height. audio,canvas,iframe,img,svg, andvideoalign to the middle of the surrounding line, avoiding the inline baseline gap.- Iframes have no default border.
- An inline SVG without its own
fillusescurrentColor, so a simple icon follows the surrounding text color.
Cirth does not make every media element full width and does not define an aspect ratio for files whose dimensions are unknown.
Common mistakes #
- Do not omit
altfrom an image because a caption exists. A caption and an image alternative serve different purposes. - Do not repeat the same wording in
altand<figcaption>unless both are necessary. Describe the image inalt; use the caption for context or a conclusion. - Do not remove native audio or video controls without supplying an equally operable replacement.
- Do not rely on an iframe's visible surroundings as its only title.