W3cubDocs

/SVG

x2

For the <line> element, this attribute define the x-axis coordinate of the end of the line. If the attribute is not specified, the effect is as if a value of 0 were specified.

For the <linearGradient> element, this attribute define the x-axis coordinate of the end of the vector gradient onto which the <stop> elements are mapped. If the attribute is not specified, the effect is as if a value of 100% were specified.

Usage context

Categories None
Value <coordinate>
Animatable Yes
Normative document SVG 1.1 (2nd Edition): The line element
SVG 1.1 (2nd Edition): The linearGradient element
<coordinate>

A <coordinate> is a length in the user coordinate system that is the given distance from the origin of the user coordinate system along the relevant axis (the x-axis for X coordinates, the y-axis for Y coordinates). Its syntax is the same as that for <length>.

Within the SVG DOM, a <coordinate> is represented as an SVGLength or an SVGAnimatedLength.

Example

The x2 attribute on the <line> element

Source code Output result

Unable to find file x2.svg

Unable to find file x2.svg

» x2.svg

The x2 attribute on the <linearGradient> element

Source code Output result

Unable to find file linearGradient.svg

Unable to find file linearGradient.svg

» linearGradient.svg

Elements

The following elements can use the x2 attribute

See also

© 2005–2017 Mozilla Developer Network and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/x2