Introduction
SVG means Scalable Vector Graphics. It is used to define vector-based graphics. HTML5 has support for inline SVG.
Here we create a circle in SVG, which can be easily embedded in our HTML5 page:
Here is the output
- <!DOCTYPE html>
- <html>
- <body>
- <svg xmlns="http://www.w3.org/2000/svg" version="1.1" height="180">
- <circle cx="100" cy="40" r="30" stroke="black"
- stroke-width="3" fill="blue"/>
- </svg>
- </body>
- </html>

- <!DOCTYPE html>
- <html>
- <body>
- <svg xmlns="http://www.w3.org/2000/svg" version="1.1" height="190">
- <polygon points="80,5 20,90 190,60 5,60 160,90"
- style="fill:Blue;stroke:Red;stroke-width:7;fill-rule:evenodd;" />
- </svg>
- </body>
- </html>

- <!DOCTYPE html>
- <html>
- <body>
- <svg xmlns="http://www.w3.org/2000/svg" version="1.1">
- <text x="0" y="19" fill="Blue" transform="rotate(30 20,60)">My name is Mahak</text>
- </svg>
- </body>
- </html>
Here is the Output

- <!DOCTYPE html>
- <html>
- <body>
- <svg xmlns="http://www.w3.org/2000/svg" version="1.1">
- <line x1="0" y1="0" x2="150" y2="150"
- style="stroke:#ff0000;stroke-width:3"/>
- </svg>
- </body>
- </html>
Here is The Output


Amir NavedPosted Dec 1, 2019, 9:47 PM EST
Thanks I have been suffering an issue and you gave the solution
Sunny SharmaPosted Jul 31, 2013, 5:56 AM EDT
nice one.
Sam HobbseditedPosted Feb 17, 2012, 10:58 AM ESTEdited Feb 17, 2012, 11:14 AM EST
Thank you. That looks useful and fun. It works for me in IE but not Visual Studio. The VS designer does not show the graphics but the graphics show when I view the file using IE separate from VS. So if anyone uses VS to enter the HTML then be aware that VS won't show the graohics but IE will.