SVG Examples
Online Examples
The following examples embed SVG code directly into HTML code.
Almost all modern browsers support SVG (Scalable Vector Graphics) format.
The following is the support status of some major browsers:
- Google Chrome: Full support for SVG, starting from version 1.0.
- Mozilla Firefox: Full support for SVG, starting from version 1.5.
- Microsoft Edge: Full support for SVG.
- Safari: Full support for SVG, starting from version 3.1.
- Opera: Full support for SVG, starting from version 9.0.
Mobile browser support:
- iOS Safari: Full support for SVG.
- Android Browser: Full support for SVG.
- Chrome for Android: Full support for SVG.
SVG Examples
SVG Basic Shapes
A rectangle with rounded corners
Three ellipses stacked on top of each other
Define a line, text, or outline color (stroke)
Define the width of a line, text, or outline (stroke-width)
The stroke-linecap attribute defines different types of endings for open paths:
Define dashed lines (stroke-dasharray)
SVG Filters
feOffset - Offset a rectangle, then blend the offset image on top
feOffset - Blur the offset image
feOffset - Make the shadow black
feOffset - Apply a color to the shadow
feOffset, feFlood, feComposite, feMerge, and feMergeNode
SVG Gradients
Horizontal linear gradient ellipse from yellow to red
Vertical linear gradient ellipse from yellow to red
Horizontal linear gradient from yellow to red with text inside the ellipse
Radial gradient ellipse from white to blue
Another radial gradient ellipse from white to blue
SVG Misc
A rectangle that repeats and fades out over 5 seconds
The rectangle grows and changes color
Three rectangles that change color
Text moving along a motion path
Other extensions