HTML <svg> tag

You are Here:

HTML <svg> tag

The <svg> tag is used as a container for SVG graphics.

The <svg> tag is used as the outermost element of SVG documents and to embed a SVG fragment inside the <svg> element in an HTML document.

Using SVG, we can draw boxes, circles, graphic images, paths, and text.

Example

HTML Online Editor
<!DOCTYPE html> <html> <body> <svg> <rect width="200" height="100" /> Sorry, your browser does not support inline SVG. </svg> </body> </html>

Tips

It is not recommended to learn SVG while taking html tutorial. Please navigate to SVG tutorial after learning basic javascript.

Attributes

The following are the attributes of <svg> tag. Also try Global attributes.

AttributeValueExplanation
widthpxSpecifies the width of the <svg> element.
heightpxSpecifies the height of the <svg> element.

Reminder

Hi Developers, we almost covered 99.5% of HTML Tutorials with examples for quick and easy learning.

We are working to cover every Single Concept in HTML.

Please do google search for:

Join Our Channel

Join our telegram channel to get an instant update on depreciation and new features on HTML, CSS, JavaScript, jQuery, Node.js, PHP and Python.

This channel is primarily useful for Full Stack Web Developer.

Share this Page

Meet the Author