• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

The polygon Element

The polygon element is designed to create closed shapes, the edges of which consist of multiple (that is, three or more) straight lines. The syntax of the polygon element is essentially identical to that of the polyline element. Listing 3.14, SimplePolygons.svg, was created by simply replacing polyline with polygon in the start tags of Listing 3.13.

Listing 3.14. SimplePolygons.svg—Two Simple Polygon Shapes

<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
<svg width="500" height="300">
<polygon style="stroke:#000000; stroke-width:2; fill:#CCCCCC;"
  points="30,200 30,50 130,50 30,200" />
<polygon style="stroke:#000000; stroke-width:2; fill:none;"
  points="230,200 230,50 330,50 230,200" />
</svg>


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint