Working with tag in HTML5


You can try to run the following code to learn how to work with the <polygon> tag in HTML5:

<html>
   <head>
      <style>
         #svgelem{
            position: relative;
            left: 50%;
            -webkit-transform: translateX(-40%);
            -ms-transform: translateX(-40%);
            transform: translateX(-40%);
         }
      </style>

      <title>SVG</title>
      <meta charset="utf-8" />
   </head>
   <body>
      <h2 align="center">HTML5 SVG Star</h2>
      <svg id="svgelem" height="200" xmlns="http://www.w3.org/2000/svg">
      <polygon points="100,10 40,180 190,60 10,60 160,180" fill="red"/>
      </svg>
   </body>
</html>

Lakshmi Srinivas
Lakshmi Srinivas

Programmer / Analyst / Technician

Updated on: 29-Jan-2020

150 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements