Menu Home

pattern

osbo.com | SVG | Elements | pattern

The pattern SVG element specifies replication at fixed intervals in x and y to cover an area to be painted.

Syntax

Attributes

height

Specifies the height of the pattern.

Value
<length-percentage>
Default
0

href

Specifies a Uniform Resource Locator (URL) reference to the element.

Value
<url>
Default
(none)

patternContentUnits

Specifies the coordinate system for the contents of the pattern element.

Value
objectBoundingBox | userSpaceOnUse
Default
userSpaceOnUse

patternTransform

Specifies an optional additional transformation from the pattern coordinate system onto the target coordinate system.

Value
<transform-list>
Default
identity transform

patternUnits

Specifies the coordinate system for the x, y, width, and height attributes.

Value
objectBoundingBox | userSpaceOnUse
Default
objectBoundingBox

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 pattern.

Value
<length-percentage>
Default
0

x

Specifies the x-coordinate of the pattern.

Value
<length-percentage>
Default
0

y

Specifies the y-coordinate of the pattern.

Value
<length-percentage>
Default
0

Examples

height

<length-percentage>

href

<url>

patternContentUnits

objectBoundingBox

userSpaceOnUse

patternTransform

<transform-list>

patternUnits

objectBoundingBox

userSpaceOnUse

viewBox

<height>

<min-x>

<min-y>

<width>

width

<length-percentage>

x

<length-percentage>

y

<length-percentage>

World Wide Web Consortium (W3C)