©
本文档使用
php.cn手册 发布
A user agent (UA) might not have the ability to process and view SVG content. The following list outlines two of the backwards compatibility scenarios associated with SVG content:
For XML grammars with the ability to embed SVG content, it is assumed that some sort of alternate representation capability such as the ‘switch’ element and some sort of feature-availability test facility (such as what is described in the SMIL 3.0 specification [SMIL]) will be available.
This ‘switch’ element and feature-availability test facility (or their equivalents) are the recommended way for XML authors to provide an alternate representation to SVG content, such as an image or a text string. The following example shows how to embed an SVG drawing within a SMIL 1.0 document such that an alternate image will display in the event the user agent doesn't support SVG. Note that the MIME type in the ‘type’ attribute is an important means for the user agent to decide if it can decode the referenced media.
In this example, the SVG content is included via a URL reference. With some parent XML grammars it will also be possible to include an SVG document fragment inline within the same file as its parent grammar.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
|
For HTML 4, SVG drawings can be embedded using the ‘object’ element. An alternate representation such as an image can be included as the content of the ‘object’ element. In this case, the SVG content usually will be included via a URL reference. The following example shows how to use the ‘object’ element to include an SVG drawing via a URL reference with an image serving as the alternate representation in the absence of an SVG user agent:
1 2 3 4 5 6 7 8 9 10 |
|