ZVON > References > Zvon Example Repository
Example repository: index | categories | search

All > SVG > Style > Using CSS within SVG - external stylesheet

Generally, there are two possibilities - embed style in the document or link an external CSS file using a processing instruction. In the former case it is recommended to enclose CSS rules in CDATA section.


Output
Output - picture
SVG version


Source
<?xml-stylesheet type="text/css" href="howto_jj_svg_29_code_2.css" ?>
<svg width="100" height="30" xmlns="http://www.w3.org/2000/svg" >
     <text x="0" y="20">Red text</text>
</svg>

Source
text {fill: red; font-family: SansSerif}