Jump to content
Sign in to follow this  

polyline tag in SVG defs

Recommended Posts

Why does my polyline tag in SVG not accept style set inside defs tag but does in normal CSS?

Here is my code: 


 .trapezoid2 { fill:beige;stroke:forestgreen;stroke-width:2; }

<center> <!-- I routinely use the center tag for older browsers. -->

<svg height="400" width="800" style="border:5px double blue;background-color:tan;margin:0 auto;" >
        <polygon id="trapezoid1" style="fill:tan;stroke:blue;stroke-width:4;" />
     <use xlink:href="#trapezoid1" points="100,200 150,100 350,100 400,200" />
     <polygon id=".trapezoid2" points="400,300 450,200 650,200 700,300" style="fill:beige;stroke:forestgreen;stroke-width:2;" />


The second trapezoid shows up but not the first.


PHPremote aka Patrick




Share this post

Link to post
Share on other sites

The <use> tag just includes the content exactly as it is in the <defs> element. You cannot put attributes on the <use> tag and expect them to be applied to the included elements.

Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Create New...