

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to draw a circle in HTML5 SVG?
SVG stands for Scalable Vector Graphics and is a language for describing 2D-graphics and graphical applications in XML and the XML is then rendered by an SVG viewer. Most of the web browsers can display SVG just like they can display PNG, GIF, and JPG.
To draw a circle in HTML SVG, use the SVG <circle> element.
Example
You can try to run the following code to learn how to draw a circle in HTML5 SVG.
<!DOCTYPE html> <html> <head> <style> #svgelem { position: relative; left: 10%; -webkit-transform: translateX(-20%); -ms-transform: translateX(-20%); transform: translateX(-20%); } </style> <title>HTML5 SVG Circle</title> </head> <body> <h2>HTML5 SVG Circle</h2> <svg id="svgelem" height="200" xmlns="http://www.w3.org/2000/svg"> <circle id="greencircle" cx="60" cy="60" r="50" fill="green" /> </svg> </body> </html>
Output
- Related Questions & Answers
- How to draw a hollow circle in SVG?
- How to draw a rectangle in HTML5 SVG?
- How to draw a line in HTML5 SVG?
- How to draw a polygon in HTML5 SVG?
- How to draw a polyline in HTML5 SVG?
- How to draw a star in HTML5 SVG?
- How to draw SVG Logo in HTML5?
- How to draw shapes using SVG in HTML5?
- How to draw an ellipse in HTML5 SVG?
- How to draw sine waves with HTML5 SVG?
- How to draw a circle with arc() in HTML5?
- How to draw an SVG file on an HTML5 canvas?
- How to draw grid using HTML5 and canvas or SVG?
- How to draw ellipses on top of each other in HTML5 SVG?
- How can I display an image inside SVG circle in HTML5?
Advertisements