SVG Styling & Effects

Definition
Styling & effects covers how SVG shapes look after you draw them: stroke outlines, filter effects, patterns, and linear or radial gradients.
After Basic Shapes, open Stroke and Filters, then Patterns and gradients.
Beginner path.
Stroke first → filters → patterns → linear gradient → radial gradient.
Syntax
A stroked circle with a simple linear fill:
SVG
<svg viewBox="0 0 200 120" xmlns="http://www.w3.org/2000/svg">
<defs>
<linearGradient id="g" x1="0" y1="0" x2="1" y2="0">
<stop offset="0%" stop-color="#2563eb"/>
<stop offset="100%" stop-color="#16a34a"/>
</linearGradient>
</defs>
<circle cx="100" cy="60" r="40"
fill="url(#g)" stroke="#0f172a" stroke-width="4"/>
</svg> Topics
Guides in the Styling & Effects section (5 tutorials).
Outline & filters
2 topicsControl edges and visual effects on existing shapes.
Fills
3 topicsPaint interiors with tiles and color ramps.
| Topic | Description | Tutorial |
|---|---|---|
Patterns | Repeating pattern fills with patternUnits. | Open |
Linear Gradients | linearGradient and stop offsets. | Open |
Radial Gradients | radialGradient for circular color ramps. | Open |
Try it
Live Preview
Adjust stroke width and a gradient mid stop on one circle.
How to Learn Styling & Effects
A practical order for this hub:
- Finish a few shapes from Basic Shapes.
- Style outlines with
strokeandstroke-width. - Try dasharray, linecap, and linejoin.
- Add a simple blur or drop-shadow filter.
- Paint with
pattern, then linear and radial gradients. - Continue to Advanced for clicks and links.
Frequently Asked Questions
How SVG shapes look: stroke width and dash patterns, filter effects, tiled patterns, and linear or radial gradient fills.
Related idea, different model. stroke paints along a shape’s outline. You control color, width, linecap, linejoin, and dashes — not a CSS box border.
Usually inside <defs>. Reference them with fill="url(#id)" or stroke="url(#id)" on the shape.
Yes. Apply filter="url(#id)" to shapes, groups, or text. Some filters are heavier — keep demos simple while learning.
Learn stroke first so outlines look intentional. Then patterns and gradients for richer fills.
This page is the index for the Styling & Effects sidebar section. Each topic page has full syntax, live demos, examples, and FAQs.
Start with SVG Stroke
Open the stroke guide — width, dashes, live preview, and examples.
8 people found this page helpful
