HTML Tags: Canvas and SVG
These are the HTML tags you use to make graphics.
Tag | Type | Description |
---|---|---|
<canvas> | Inline | Used to draw graphics with canvas scripting API or WebGL API |
<svg> | Inline | Used to draw graphics using SVG |
<canvas>
Used to draw graphics with canvas scripting API or WebGL API.
Possible attributes
height=[...]
— height of the canvaswidth=[...]
— width of the canvas
| LIVE PREVIEW
If nothing appears below, refresh the page.
the SVG viewport coordinates, i.e.minX minY width height
height=[...]
— the displayed height (viewport height)width=[...]
— the displayed width (viewport width)x=[...]
— at which x coordinate a nested <svg>
should be put (no effect if given to the outhermost <svg>
)y=[...]
— at which y coordinate a nested <svg>
should be put (no effect if given to the outhermost <svg>
)preserveAspectRatio=[...]
— indicates how to fit the viewbox (internal coordinate system) to the viewport (the displayed width and height). The default value is xMidYMid meet
. (See possible values here) | LIVE PREVIEW
References
- HTML elements reference (MDN) — https://developer.mozilla.org/en-US/docs/Web/HTML/Element
- Eliminate Render-Blocking JavaScript with Async and Defer: Async vs Defer — https://www.digitalocean.com/community/tutorials/html-defer-async