<feBlend>
<feColorMatrix>
<feComponentTransfer>
<feComposite>
<feConvolveMatrix>
<feDiffuseLighting>
<feDisplacementMap>
<feDistantLight>
<feFlood>
<feFuncA>
<feFuncB>
<feFuncG>
<feFuncR>
<feGaussianBlur>
<feImage>
<feMerge>
<feMergeNode>
<feMorphology>
<feOffset>
<fePointLight>
<feSpecularLighting>
<feSpotLight>
<feTile>
<feTurbulence>
<filter>
<font>
<font-face>
<font-face-format>
<font-face-name>
<font-face-src>
<font-face-uri>
<foreignObject>
x
attribute defines an x-axis coordinate in the user coordinate system.
You can use this attribute with the following SVG elements:
<altGlyph>
<cursor>
<feBlend>
<feColorMatrix>
<feComponentTransfer>
<feComposite>
<feConvolveMatrix>
<feDiffuseLighting>
<feDisplacementMap>
<feDropShadow>
<feFlood>
<feFuncA>
<feFuncB>
<feFuncG>
<feFuncR>
<feGaussianBlur>
<feImage>
<feMerge>
<feMergeNode>
<feMorphology>
<feOffset>
<fePointLight>
<feSpecularLighting>
<feSpotLight>
<feTile>
<feTurbulence>
<filter>
<foreignObject>
<glyphRef>
<image>
<mask>
<pattern>
<rect>
<svg>
<symbol>
<text>
<tref>
<tspan>
<use>
<svg viewBox="0 0 300 100" xmlns="http://www.w3.org/2000/svg">
<rect x="20" y="20" width="60" height="60" />
<rect x="120" y="20" width="60" height="60" />
<rect x="220" y="20" width="60" height="60" />
</svg>
警告:
As of SVG2
<altGlyph>
is deprecated and shouldn't be used.
For
<altGlyph>
,
x
defines the x-axis coordinate of the alternate glyph.
| 值 | List of <length> |
|---|---|
| 默认值 | none |
| Animatable | Yes |
For
<feBlend>
,
x
defines the minimum x coordinate for the rendering area of the primitive.
| 值 | <length> | <percentage> |
|---|---|
| 默认值 |
0%
|
| Animatable | Yes |
For
<feColorMatrix>
,
x
defines the minimum x coordinate for the rendering area of the primitive.
| 值 | <length> | <percentage> |
|---|---|
| 默认值 |
0%
|
| Animatable | Yes |
For
<feComponentTransfer>
,
x
defines the minimum x coordinate for the rendering area of the primitive.
| 值 | <length> | <percentage> |
|---|---|
| 默认值 |
0%
|
| Animatable | Yes |
For
<feComposite>
,
x
defines the minimum x coordinate for the rendering area of the primitive.
| 值 | <length> | <percentage> |
|---|---|
| 默认值 |
0%
|
| Animatable | Yes |
For
<feConvolveMatrix>
,
x
defines the minimum x coordinate for the rendering area of the primitive.
| 值 | <length> | <percentage> |
|---|---|
| 默认值 |
0%
|
| Animatable | Yes |
For
<feDiffuseLighting>
,
x
defines the minimum x coordinate for the rendering area of the primitive.
| 值 | <length> | <percentage> |
|---|---|
| 默认值 |
0%
|
| Animatable | Yes |
For
<feDisplacementMap>
,
x
defines the minimum x coordinate for the rendering area of the primitive.
| 值 | <length> | <percentage> |
|---|---|
| 默认值 |
0%
|
| Animatable | Yes |
For
<feDropShadow>
,
x
defines the minimum x coordinate for the rendering area of the primitive.
| 值 | <length> | <percentage> |
|---|---|
| 默认值 |
0%
|
| Animatable | Yes |
For
<feFlood>
,
x
defines the minimum x coordinate for the rendering area of the primitive.
| 值 | <length> | <percentage> |
|---|---|
| 默认值 |
0%
|
| Animatable | Yes |
For
<feFuncA>
,
x
defines the minimum x coordinate for the rendering area of the primitive.
| 值 | <length> | <percentage> |
|---|---|
| 默认值 |
0%
|
| Animatable | Yes |
For
<feFuncB>
,
x
defines the minimum x coordinate for the rendering area of the primitive.
| 值 | <length> | <percentage> |
|---|---|
| 默认值 |
0%
|
| Animatable | Yes |
For
<feFuncG>
,
x
defines the minimum x coordinate for the rendering area of the primitive.
| 值 | <length> | <percentage> |
|---|---|
| 默认值 |
0%
|
| Animatable | Yes |
For
<feFuncR>
,
x
defines the minimum x coordinate for the rendering area of the primitive.
| 值 | <length> | <percentage> |
|---|---|
| 默认值 |
0%
|
| Animatable | Yes |
For
<feGaussianBlur>
,
x
defines the minimum x coordinate for the rendering area of the primitive.
| 值 | <length> | <percentage> |
|---|---|
| 默认值 |
0%
|
| Animatable | Yes |
For
<feImage>
,
x
defines the minimum x coordinate for the rendering area of the primitive.
| 值 | <length> | <percentage> |
|---|---|
| 默认值 |
0%
|
| Animatable | Yes |
For
<feMerge>
,
x
defines the minimum x coordinate for the rendering area of the primitive.
| 值 | <length> | <percentage> |
|---|---|
| 默认值 |
0%
|
| Animatable | Yes |
For
<feMergeNode>
,
x
defines the minimum x coordinate for the rendering area of the primitive.
| 值 | <length> | <percentage> |
|---|---|
| 默认值 |
0%
|
| Animatable | Yes |
For
<feMorphology>
,
x
defines the minimum x coordinate for the rendering area of the primitive.
| 值 | <length> | <percentage> |
|---|---|
| 默认值 |
0%
|
| Animatable | Yes |
For
<feOffset>
,
x
defines the minimum x coordinate for the rendering area of the primitive.
| 值 | <length> | <percentage> |
|---|---|
| 默认值 |
0%
|
| Animatable | Yes |
For
<fePointLight>
,
x
defines the x location for the light source in the coordinate system defined by the
primitiveUnits
属性在
<filter>
元素。
| 值 | <number> |
|---|---|
| 默认值 |
0
|
| Animatable | Yes |
For
<feSpecularLighting>
,
x
defines the minimum x coordinate for the rendering area of the primitive.
| 值 | <length> | <percentage> |
|---|---|
| 默认值 |
0%
|
| Animatable | Yes |
For
<feSpotLight>
,
x
defines the x location for the light source in the coordinate system defined by the
primitiveUnits
属性在
<filter>
元素。
| 值 | <number> |
|---|---|
| 默认值 |
0
|
| Animatable | Yes |
For
<feTile>
,
x
defines the minimum x coordinate for the rendering area of the primitive.
| 值 | <length> | <percentage> |
|---|---|
| 默认值 |
0%
|
| Animatable | Yes |
For
<feTurbulence>
,
x
defines the minimum x coordinate for the rendering area of the primitive.
| 值 | <length> | <percentage> |
|---|---|
| 默认值 |
0%
|
| Animatable | Yes |
For
<filter>
,
x
defines the x coordinate of the upper left corner for the rendering area of the filter.
| 值 | <length> | <percentage> |
|---|---|
| 默认值 |
-10%
|
| Animatable | Yes |
For
<foreignObject>
,
x
defines the x coordinate of the upper left corner of its viewport.
| 值 | <length> | <percentage> |
|---|---|
| 默认值 |
0
|
| Animatable | Yes |
注意:
Starting with SVG2,
x
是
Geometry Property
meaning this attribute can also be used as a CSS property for
<foreignObject>
.
警告:
As of SVG2
<glyphRef>
is deprecated and shouldn't be used.
For
<glyphRef>
,
x
defines the x-axis coordinate of the glyph.
| 值 | <number> |
|---|---|
| 默认值 |
0
for the first glyphRef, and the end x coordinate of the
上一
<glyphRef>
for all subsequent sibling
<glyphRef>
.
|
| Animatable | Yes |
For
<image>
,
x
defines the x coordinate of the upper left corner of the image.
| 值 | <length> | <percentage> |
|---|---|
| 默认值 |
0
|
| Animatable | Yes |
注意:
Starting with SVG2,
x
是
Geometry Property
meaning this attribute can also be used as a CSS property for images.
For
<mask>
,
x
defines the x coordinate of the upper left corner of its area of effect. The exact effect of this attribute is influenced by the
maskUnits
属性。
| 值 | <length> | <percentage> |
|---|---|
| 默认值 |
-10%
|
| Animatable | Yes |
For
<pattern>
,
x
defines the x coordinate of the upper left corner of the tile pattern. The exact effect of this attribute is influenced by the
patternUnits
and
patternTransform
属性。
| 值 | <length> |
|---|---|
| 默认值 |
0
|
| Animatable | Yes |
For
<rect>
,
x
defines the x coordinate of the upper left corner of the shape.
| 值 | <length> | <percentage> |
|---|---|
| 默认值 |
0
|
| Animatable | Yes |
注意:
Starting with SVG2,
x
是
Geometry Property
meaning this attribute can also be used as a CSS property for rectangles.
For
<svg>
,
x
defines the x coordinate of the upper left corner of its viewport.
| 值 | <length> | <percentage> |
|---|---|
| 默认值 |
0
|
| Animatable | Yes |
注意:
Starting with SVG2,
x
是
Geometry Property
meaning this attribute can also be used as a CSS property for
<svg>
.
For
<text>
, if it contain a single value,
x
defines the x coordinate on where the
content text position
must be placed. The
content text position
is usually a point on the baseline of the first line of text. The exact
content text position
is influenced by some properties like
text-anchor
,或
direction
.
If there are multiple values,
x
defines the x coordinate of each individual glyph from the text. If there are less values than glyphs, the remaining glyphs are placed in the continuity of the last positioned glyph. If there are more values than glyphs, extra values are ignored.
| 值 | List of ( <length> | <percentage> ) |
|---|---|
| 默认值 |
0
|
| Animatable | Yes |
<svg viewBox="0 0 200 100" xmlns="http://www.w3.org/2000/svg">
<!-- horizontal line to materialized the text base line -->
<line x1="0" y1="40%" x2="100%" y2="40%" />
<line x1="0" y1="90%" x2="100%" y2="90%" />
<!-- vertical line to materialized the x positioning -->
<line x1="25%" y1="0" x2="25%" y2="100%" />
<line x1="50%" y1="0" x2="50%" y2="100%" />
<line x1="75%" y1="0" x2="75%" y2="100%" />
<!-- x with a single value -->
<text y="40%" x="50%">SVG</text>
<!-- x with multiple values -->
<text y="90%" x="25%, 50%, 75%">SVG</text>
</svg>
text {
font: 40px sans-serif;
}
line {
fill: none;
stroke: red;
stroke-width: .5px;
stroke-dasharray: 2px;
}
警告:
As of SVG2
<tref>
is deprecated and shouldn't be used.
For
<tref>
, if it contain a single value,
x
defines the x coordinate on where the
content text position
must be placed. The
content text position
is usually a point on the baseline of the first line of text. The exact
content text position
is influenced by some properties like
text-anchor
,或
direction
.
If there are multiple values,
x
defines the x coordinate of each individual glyph from the text. If there are less values than glyphs, the remaining glyphs are placed in the continuity of the last positioned glyph. If there are more values than glyphs, extra values are ignored.
| 值 | List of ( <length> | <percentage> ) |
|---|---|
| 默认值 |
0
|
| Animatable | Yes |
For
<tspan>
, if it contain a single value,
x
defines the x coordinate on where the
content text position
must be placed. The
content text position
is usually a point on the baseline of the first line of text. The exact
content text position
is influenced by some properties like
text-anchor
,或
direction
.
If there are multiple values,
x
defines the x coordinate of each individual glyph from the text. If there are less values than glyphs, the remaining glyphs are placed in the continuity of the last positioned glyph. If there are more values than glyphs, extra values are ignored.
| 值 | List of ( <length> | <percentage> ) |
|---|---|
| 默认值 | none |
| Animatable | Yes |
<svg viewBox="0 0 200 100" xmlns="http://www.w3.org/2000/svg">
<!-- horizontal line to materialized the text base line -->
<line x1="0" y1="40%" x2="100%" y2="40%" />
<line x1="0" y1="90%" x2="100%" y2="90%" />
<!-- vertical line to materialized the x positioning -->
<line x1="25%" y1="0" x2="25%" y2="100%" />
<line x1="50%" y1="0" x2="50%" y2="100%" />
<line x1="75%" y1="0" x2="75%" y2="100%" />
<text>
<!-- x with a single value -->
<tspan y="40%" x="50%">SVG</tspan>
<!-- x with multiple values -->
<tspan y="90%" x="25%, 50%, 75%">SVG</tspan>
</text>
</svg>
text {
font: 40px sans-serif;
}
line {
fill: none;
stroke: red;
stroke-width: .5px;
stroke-dasharray: 2px;
}
For
<use>
,
x
defines the x coordinate of the upper left corner of the referenced element.
| 值 | <length> | <percentage> |
|---|---|
| 默认值 |
0
|
| Animatable | Yes |
注意:
Starting with SVG2,
x
是
Geometry Property
meaning this attribute can also be used as a CSS property for used elements.
最后修改: , 由 MDN 贡献者