Experimental:
这是
实验性技术
检查
浏览器兼容性表格
要小心谨慎在生产中使用这之前。
<hatch>
SVG
element is used to fill or stroke an object using one or more pre-defined paths that are repeated at fixed intervals in a specified direction to cover the areas to be painted.
Hatches defined by the
<hatch>
element can then referenced by the
fill
and
stroke
CSS
properties on a given
graphics element
to indicate that the given element shall be filled or stroked with the hatch. Paths are defined by
<hatchpath>
元素。
This element implements the
SVGHatchElement
接口。
<svg width="200" height="200" xmlns="http://www.w3.org/2000/svg">
<
defs
>
<
hatch
id
=
"
hatch
"
hatchUnits
=
"
userSpaceOnUse
"
pitch
=
"
5
"
rotate
=
"
135
"
>
<
hatchpath
stroke
=
"
#a080ff
"
stroke-width
=
"
2
"
/>
</
hatch
>
</
defs
>
<
rect
fill
=
"
url(#hatch)
"
stroke
=
"
black
"
stroke-width
=
"
2
"
x
=
"
10%
"
y
=
"
10%
"
width
=
"
80%
"
height
=
"
80%
"
/>
</
svg
>
BCD tables only load in the browser
Found a problem with this page?
最后修改:
,
由 MDN 贡献者