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

External Style Sheets

As we said, creating embedded style sheets is fine if you are going to use those styles for only one SVG file. However, if you want a style sheet to be referenced by more than one document, consider using an external CSS. An external style sheet looks like the internal style sheet, but it is saved as a separate CSS document, then referenced by the SVG document that uses the particular styles. To change the internal style sheet in Example 8-4 to an external style sheet, create a separate document and copy all of the style definitions into that document, like so:

.myStyle {
     fill:red;
     stroke:orange;
     stroke-width:2
     }

.yourStyle {
     fill:blue;
     stroke:black;
     fill-opacity:.5
     }

.ourStyle {
     fill:none;
     stroke:green
     }

The style code ...

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