svg

The svg SVG element specifies the coordinate system and viewport.

Syntax

Attributes

height

Specifies the height of the element.

Value
auto | <length-percentage>
Default
auto

preserveAspectRatio

Specifies whether or not to force uniform scaling.

Value
<align> <meetOrSlice>?
Default
xMidYMid meet

transform

Specifies a transformation to the coordinate system.

Value
none | <transform-list>
Default
none

viewBox

Specifies a rectangle in user space.

A list of four numbers: min-x, min-y, width, and height that should be mapped to the bounds of the SVG viewport established by the given element, taking into account the preserveAspectRatio attribute. The presence of the viewBox attribute results in a transformation being applied to the viewport coordinate system.

Value
[ <min-x>,? <min-y>,? <width>,? <height> ]
Default
(none)

width

Specifies the width of the element.

Value
auto | <length-percentage>
Default
auto

x

Specifies the x-coordinate of the element.

Setting the outer svg element will have no effect.

Value
<length-percentage>
Default
0

y

Specifies the y-coordinate of the element.

Setting the outer svg element will have no effect.

Value
<length-percentage>
Default
0

zoomAndPan

Specifies magnification and panning.

Setting the inner svg element will have no effect.

Value
disable | magnify
Default
magnify

Examples

height

auto

<length-percentage>

preserveAspectRatio

<align>

<meetOrSlice>

transform

none

<transform-list>

viewBox

<height>

<min-x>

<min-y>

<width>

width

auto

<length-percentage>

x

<length-percentage>

y

<length-percentage>

zoomAndPan

disable

magnify

Internal

defs

desc

g

metadata

switch

symbol

title

unknown

use

External

World Wide Web Consortium (W3C)

Home Menu