On this page
<svg>
Prev: `<table>` | Up: media | Next: `<canvas>`
Rel: media, Tables & Media Guide
Ref: MDN Web Docs — <svg>
Tags: #public #web #html #elements #media #tier/standard
Summary
Inline scalable vector graphics directly styleable via CSS (currentColor).
- Implicit ARIA Role:
graphics-document - DOM Interface:
SVGSVGElement - Key Attributes:
viewBox, width, height, aria-hidden
Notes & Best Practices
- Always set
viewBoxfor crisp scaling; addaria-hidden="true"on decorative icons orrole="img"+<title>on meaningful graphics.
Example
<svg viewBox="0 0 24 24" width="24" height="24" aria-hidden="true">
<circle cx="12" cy="12" r="9" fill="none" stroke="currentColor" stroke-width="2" />
</svg>
Linked from
Related notes
- tuts/html/elements/media/canvas Linked here; links to this page; shared tags: #elements, #html, #media, #tier, #web
- tuts/html/elements/media/table Linked here; links to this page; shared tags: #elements, #html, #media, #tier, #web
- tuts/html/elements/media Linked here; links to this page; shared tags: #elements, #html, #media, #web
- tuts/html/elements/tables_and_media Linked here; shared tags: #elements, #html, #media, #web
- tuts/html/elements/media/figure shared tags: #elements, #html, #media, #tier, #web
- tuts/html/elements/media/img shared tags: #elements, #html, #media, #tier, #web
- tuts/html/elements/media/marquee shared tags: #elements, #html, #media, #tier, #web
- tuts/html/elements/media/picture shared tags: #elements, #html, #media, #tier, #web
- tuts/html/elements/media/video shared tags: #elements, #html, #media, #tier, #web
- tuts/html/elements/forms/button shared tags: #elements, #html, #tier, #web