<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>
width
attribute defines the horizontal length of an element in the user coordinate system.
You can use this attribute with the following SVG elements:
<feBlend>
<feColorMatrix>
<feComponentTransfer>
<feComposite>
<feConvolveMatrix>
<feDiffuseLighting>
<feDisplacementMap>
<feDropShadow>
<feFlood>
<feGaussianBlur>
<feImage>
<feMerge>
<feMorphology>
<feOffset>
<feSpecularLighting>
<feTile>
<feTurbulence>
<filter>
<foreignObject>
<image>
<mask>
<pattern>
<rect>
<svg>
<use>
<svg viewBox="0 0 100 300" xmlns="http://www.w3.org/2000/svg">
<!-- With a width of 0 or less, nothing will be rendered -->
<rect x="0" y="0" width="0" height="90"/>
<rect x="0" y="100" width="60" height="90"/>
<rect x="0" y="200" width="100%" height="90"/>
</svg>
For
<feBlend>
,
width
defines the horizontal length for the rendering area of the primitive.
| 值 | <length> | <percentage> |
|---|---|
| 默认值 |
100%
|
| Animatable | Yes |
For
<feColorMatrix>
,
width
defines the horizontal length for the rendering area of the primitive.
| 值 | <length> | <percentage> |
|---|---|
| 默认值 |
100%
|
| Animatable | Yes |
For
<feComponentTransfer>
,
width
defines the horizontal length for the rendering area of the primitive.
| 值 | <length> | <percentage> |
|---|---|
| 默认值 |
100%
|
| Animatable | Yes |
For
<feComposite>
,
width
defines the horizontal length for the rendering area of the primitive.
| 值 | <length> | <percentage> |
|---|---|
| 默认值 |
100%
|
| Animatable | Yes |
For
<feConvolveMatrix>
,
width
defines the horizontal length for the rendering area of the primitive.
| 值 | <length> | <percentage> |
|---|---|
| 默认值 |
100%
|
| Animatable | Yes |
For
<feDiffuseLighting>
,
width
defines the horizontal length for the rendering area of the primitive.
| 值 | <length> | <percentage> |
|---|---|
| 默认值 |
100%
|
| Animatable | Yes |
For
<feDisplacementMap>
,
width
defines the horizontal length for the rendering area of the primitive.
| 值 | <length> | <percentage> |
|---|---|
| 默认值 |
100%
|
| Animatable | Yes |
For
<feDropShadow>
,
width
defines the horizontal length for the rendering area of the primitive.
| 值 | <length> | <percentage> |
|---|---|
| 默认值 |
100%
|
| Animatable | Yes |
For
<feFlood>
,
width
defines the horizontal length for the rendering area of the primitive.
| 值 | <length> | <percentage> |
|---|---|
| 默认值 |
100%
|
| Animatable | Yes |
For
<feGaussianBlur>
,
width
defines the horizontal length for the rendering area of the primitive.
| 值 | <length> | <percentage> |
|---|---|
| 默认值 |
100%
|
| Animatable | Yes |
For
<feImage>
,
width
defines the horizontal length for the rendering area of the primitive.
| 值 | <length> | <percentage> |
|---|---|
| 默认值 |
100%
|
| Animatable | Yes |
For
<feMerge>
,
width
defines the horizontal length for the rendering area of the primitive.
| 值 | <length> | <percentage> |
|---|---|
| 默认值 |
100%
|
| Animatable | Yes |
For
<feMorphology>
,
width
defines the horizontal length for the rendering area of the primitive.
| 值 | <length> | <percentage> |
|---|---|
| 默认值 |
100%
|
| Animatable | Yes |
For
<feOffset>
,
width
defines the horizontal length for the rendering area of the primitive.
| 值 | <length> | <percentage> |
|---|---|
| 默认值 |
100%
|
| Animatable | Yes |
For
<feSpecularLighting>
,
width
defines the horizontal length for the rendering area of the primitive.
| 值 | <length> | <percentage> |
|---|---|
| 默认值 |
100%
|
| Animatable | Yes |
For
<feTile>
,
width
defines the horizontal length for the rendering area of the primitive.
| 值 | <length> | <percentage> |
|---|---|
| 默认值 |
100%
|
| Animatable | Yes |
For
<feTurbulence>
,
width
defines the horizontal length for the rendering area of the primitive.
| 值 | <length> | <percentage> |
|---|---|
| 默认值 |
100%
|
| Animatable | Yes |
For
<filter>
,
width
defines the horizontal length for the rendering area of the filter.
| 值 | <length> | <percentage> |
|---|---|
| 默认值 |
120%
|
| Animatable | Yes |
For
<foreignObject>
,
width
defines the horizontal length for the rendering area for the referenced document.
| 值 |
auto
|
<length>
|
<percentage>
|
|---|---|
| 默认值 |
auto
(treated as
0
)
|
| Animatable | Yes |
注意:
Starting with SVG2,
width
是
Geometry Property
meaning this attribute can also be used as a CSS property for
<foreignObject>
.
For
<image>
,
width
defines the horizontal length for the image.
| 值 |
auto
|
<length>
|
<percentage>
|
|---|---|
| 默认值 |
auto
(treated as the intrinsic width of the image)
|
| Animatable | Yes |
注意:
Starting with SVG2,
width
是
Geometry Property
meaning this attribute can also be used as a CSS property for images.
For
<mask>
,
width
defines the horizontal length of its area of effect. The exact effect of this attribute is influenced by the
maskUnits
属性。
| 值 | <length> | <percentage> |
|---|---|
| 默认值 |
120%
|
| Animatable | Yes |
For
<pattern>
,
width
defines the horizontal length of the tile pattern. The exact effect of this attribute is influenced by the
patternUnits
and
patternTransform
属性。
| 值 | <length> |
|---|---|
| 默认值 |
0
|
| Animatable | Yes |
For
<rect>
,
width
defines the horizontal length for the rectangle.
| 值 |
auto
|
<length>
|
<percentage>
|
|---|---|
| 默认值 |
auto
(treated as
0
)
|
| Animatable | Yes |
注意:
Starting with SVG2,
width
是
Geometry Property
meaning this attribute can also be used as a CSS property for rectangles.
For
<svg>
,
width
defines the horizontal length for the rendering area of the SVG viewport.
注意:
In an HTML document if both the
viewBox
and
width
attributes are omitted,
the svg element will be rendered with a width of
300px
| 值 |
auto
|
<length>
|
<percentage>
|
|---|---|
| 默认值 |
auto
(treated as
100%
)
|
| Animatable | Yes |
注意:
Starting with SVG2,
width
是
Geometry Property
meaning this attribute can also be used as a CSS property for
<svg>
.
For
<use>
,
width
defines the horizontal length for the referenced element.
| 值 |
auto
|
<length>
|
<percentage>
|
|---|---|
| 默认值 |
auto
(treated as
0
)
|
| Animatable | Yes |
注意:
width
不起作用对
使用
elements, unless the element referenced has a
viewbox
- i.e. they only have an effect when
使用
refers to a
svg
or
symbol
元素。
注意:
Starting with SVG2,
width
是
Geometry Property
meaning this attribute can also be used as a CSS property for used elements.
最后修改: , 由 MDN 贡献者