Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • How to draw shapes using HTML5 tag

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 314
    Comment on it

    Hello Reader's! in this blog you will learn how to draw the shapes and figure using just html5 tags. In html 5 you can draw some basic shape like square and rectangle and circles. Let's see some of them no

    <svg width="300" height="100">
      <circle cx="50" cy="50" r="40" stroke="red" stroke-width="4" fill="blue" />
    </svg>
    

    Output:-

    In the code above i have used shape of circle in the tag with red color for stroke and blue color for fill. And you can easily change the width or height of shape also.

    Simliarly you can also make star shape by using the polygon tag:-

    <svg width="300" height="200">
      <polygon points="100,10 40,198 190,78 10,78 160,198"
      style="fill:lime;stroke:purple;stroke-width:5;fill-rule:evenodd;" />
    </svg>
    

    Output:-

    In the code above you easily set the cordinate on which the edge of polygon will turn also colors and its size. So you can see by using HTML5 tag 'svg' you can easily draw the figures in real time.

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: