Jump to content
Sign in to follow this  
PHPremote

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: 

<html>
<body>

<style>
 .trapezoid2 { fill:beige;stroke:forestgreen;stroke-width:2; }
</style>

<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;" >
  <defs>
        <polygon id="trapezoid1" style="fill:tan;stroke:blue;stroke-width:4;" />
  </defs>
    
     <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;" />
</svg>

</center>
</body>
</html>

The second trapezoid shows up but not the first.

Thanks,

PHPremote aka Patrick

 

 

w3forum_polyline_defJune3.html

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.

Guest
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.

Loading...
Sign in to follow this  

×
×
  • Create New...