Skip to Main Content
SVG for Web Developers
book

SVG for Web Developers

by Ellen Pearlman, Lorien House
December 2002
Beginner to intermediate content levelBeginner to intermediate
464 pages
8h 34m
English
Pearson
Content preview from SVG for Web Developers

Colors in SVG: Filling and Stroking

The fill property paints the inside of a shape, path, or text with color, and the stroke property outlines the shape, path, or text. Understanding how SVG paints an object is important, because you can then control how an object will render. SVG has a painting order that it uses to create and paint objects. Objects are painted in the order in which they appear in the code. If two objects intersect, the object that was painted last will appear on top of the one that was painted first.

For instance, in the code snippet:

<rect x="50" y="50" rx="20" ry="20" width="300" 
height="300" style="fill:navy; stroke:#666"/>

<circle cx="200" cy="200" r="50" style="fill:green"/>

the rectangle will appear under the circle. ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Building Web Applications with SVG

Building Web Applications with SVG

Jon Frost David Dailey and Domenico Strazzullo
SVG Text Layout

SVG Text Layout

Amelia Bellamy-Royds, Kurt Cagle
Using SVG with CSS3 and HTML5

Using SVG with CSS3 and HTML5

Amelia Bellamy-Royds, Kurt Cagle, Dudley Storey

Publisher Resources

ISBN: 0131004999Purchase book