非常教程

SVG参考手册

属性 | Attributes

externalresourcesrequired

文档经常引用和使用其他文件(和其他Web资源)的内容作为其渲染的一部分。在某些情况下,作者想要指定文档被认为是正确的需要特定的资源。

externalResourcesRequired属性在所有容器元素和所有可能可以引用外部资源的元素上都可用。它指定是否需要引用的资源不是当前文档的一部分,才能正确呈现给定的容器元素或图形元素。

此属性适用于所有类型的资源引用,包括使用<font-face>元素或CSS @ font-face规范的引用指定的样式表,颜色配置文件和字体。特别是,如果一个元素设置了externalResourcesRequired="true",那么所有样式表必须是可用的,因为任何样式表都可能影响该元素的呈现。

externalResourcesRequired属性不是可继承的(从属性值继承的意义上说),但是如果在容器元素上设置,则其值将应用于容器内的所有元素。

因为externalResourcesRequired="true"在容器元素上设置会禁用渐进显示该容器的内容,如果该容器包含引用外部资源的元素,作者应该避免简单地在通用的基础上对最外层的svg元素设置externalResourcesRequired="true"。相反,最好在那些特别需要外部资源可用性的特定图形元素或容器元素上指定externalResourcesRequired="true",以便正确渲染。

用法上下文

Categories

None

Value

true | false

Animatable

No

Normative document

SVG 1.1 (2nd Edition)

true——表示需要当前文档外部的资源。如果外部资源不可用,渐进式渲染暂停,文档的SVGLoad事件不会被触发,动画时间轴直到该资源和所有其他所需资源变为可用时才会开始,已经被解析并准备好进行渲染。

false——它指示当前文档外部的资源是可选的。即使外部资源对当前元素及其后代不可用,文档渲染也可以继续进行。这是默认值。

实例

适用元素

以下元素可以使用该externalResourcesRequired属性

  • Animation elements »
  • Gradient elements »
  • Graphics elements »
  • Text content elements »
  • Structural elements »
  • <a>
  • <clippath>
  • <cursor>
  • <feimage>
  • <filter>
  • <font>
  • <foreignobject>
  • <marker>
  • <mask>
  • <mpath>
  • <pattern>
  • <script>
  • <switch>
  • <view>

属性 | Attributes相关

1.accent-height(焦点高度)
2.accumulate(积累)
3.additive
4.alignment-baseline(对齐基线)
5.ascent
6.attributename(属性名字)
7.Attributes(属性)
8.attributetype(属性类型)
9.azimuth(方位)
10.basefrequency
11.baseline-shift(基线漂移)
12.baseprofile
13.begin(开始)
14.bias(偏压)
15.calcmode
16.class
17.clip(剪辑)
18.clip-path(剪辑路径)
19.clip-rule(剪辑规则)
20.clippathunits
21.color(颜色)
22.color-interpolation(彩色插值)
23.color-interpolation-filters(色彩插值滤波器)
24.color-profile(彩色轮廓)
25.color-rendering(显色)
26.contentscripttype
27.contentstyletype
28.cursor(光标)
29.cx
30.cy
31.d
32.diffuseconstant
33.direction(方向)
34.display(显示)
35.divisor
36.dominant-baseline(显性基线)
37.dur
38.dx
39.dy
40.edgemode
41.elevation
42.end
43.fill
44.fill-opacity
45.fill-rule
46.filter
47.filterres
48.filterunits
49.flood-color
50.flood-opacity
51.font-family
52.font-size
53.font-size-adjust
54.font-stretch
55.font-style
56.font-variant
57.font-weight
58.fr
59.from
60.fx
61.fy
62.gradienttransform
63.gradientunits
64.height
65.href
66.image-rendering
67.in
68.in2
69.k1
70.k2
71.k3
72.k4
73.kernelmatrix
74.kernelunitlength
75.kerning
76.keysplines
77.keytimes
78.lengthadjust
79.letter-spacing
80.lighting-color
81.limitingconeangle
82.local
83.marker-end
84.marker-mid
85.marker-start
86.markerheight
87.markerunits
88.markerwidth
89.mask
90.maskcontentunits
91.maskunits
92.max
93.min
94.mode
95.numoctaves
96.opacity
97.operator
98.order
99.overflow
100.overline-position
SVG

可缩放矢量图形是基于可扩展标记语言(标准通用标记语言的子集),用于描述二维矢量图形的一种图形格式。它由万维网联盟制定,是一个开放标准。