Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

SVG Tutorial

SVG Tutorial

SVG stands for Scalable Vector Graphics.

SVG is an XML markup language for describing two-dimensional graphics. Unlike bitmap images, SVG images are stored as text and can be scaled to any size without distortion, because they are based on mathematical descriptions rather than pixels.

SVG graphics are scalable and resolution-independent, which means they can be enlarged or reduced without distortion.

SVG is widely used in web design, icon creation, data visualization, and other graphics-related fields.


Main features of SVG


Application scenarios of SVG


A simple example

We created a simple red circle with a black border:

SVG Examples

<

html

<

body

<

h1

My first SVG

h1

<

svg

xmlns

=

"

http://www.w3.org/2000/svg

"

version

=

"

1.1

"

<

circle

cx

=

"

100

"

cy

=

"

50

"

r

=

"

40

"

stroke

=

"

black

"

stroke-width

=

"

2

"

fill

=

"

red

"

/>

svg

body

html

Try it »

Click the "Try it" button to see the running result.

SVG Examples

We can edit SVG examples online and view the running results online!

Online example

SVG Reference Manual

In the Runoob Tutorial, we provide you with a complete SVG reference manual, which lists all SVG elements in the W3C recommended standard (SVG Version 1.1).