From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- files/zh-cn/web/svg/element/image/index.html | 143 +++++++++++++++++++++++++++ 1 file changed, 143 insertions(+) create mode 100644 files/zh-cn/web/svg/element/image/index.html (limited to 'files/zh-cn/web/svg/element/image') diff --git a/files/zh-cn/web/svg/element/image/index.html b/files/zh-cn/web/svg/element/image/index.html new file mode 100644 index 0000000000..4f9f2710b8 --- /dev/null +++ b/files/zh-cn/web/svg/element/image/index.html @@ -0,0 +1,143 @@ +--- +title: image +slug: Web/SVG/Element/image +tags: + - SVG + - SVG图形 + - 元素 + - 参考 +translation_of: Web/SVG/Element/image +--- +
{{SVGRef}}
+ +

SVG文档中的SVG元素包含图像信息。它表现为图像文件或者其他SVG文件。

+ +

SVG图像格式转换软件支持JPEG、PNG格式,是否支持动图GIF不明确。

+ +

SVG文件是这样的一种图像:不被当做外部资源加载,不可以用:visited 样式,不能有交互。使用动态SVG元素,可以用<use>引入外部的URL。使用SVG文件并添加scripts在里面,可以用<object> 放在 <foreignObject>中。

+ +

注意:HTML规范中定义<image>和<img>在解析时是等效的。这种规范只适用于SVG文件或SVG区块内。

+ +

用法

+ +

{{svginfo}}

+ +

属性

+ +

全局属性

+ + + +

专有属性

+ + + +

DOM接口

+ +

该元素实现SVGImageElement 接口。

+ +

示例

+ +

在SVG对象中基本呈现PNG图像:

+ +
<svg width="100%" height="100%" viewBox="0 0 100 100"
+     xmlns="http://www.w3.org/2000/svg"
+     xmlns:xlink="http://www.w3.org/1999/xlink">
+  <image xlink:href="/files/2917/fxlogo.png" x="0" y="0" height="100" width="100" />
+</svg>
+
+ +

{{EmbedLiveSample("Example", 250, 260)}}

+ +

说明

+ + + + + + + + + + + + + + + + + + + + + +
版本状态注释
{{SpecName('SVG2', 'embedded.html#ImageElement', '<image>')}}{{Spec2('SVG2')}} 候选推荐允许省略高度和宽度
{{SpecName('SVG1.1', 'struct.html#ImageElement', '<image>')}}{{Spec2('SVG1.1')}} 推荐初版规范
+ +

浏览器兼容性

+ +

{{ CompatibilityTable() }}

+ +
+ + + + + + + + + + + + + + + + + + + +
FeatureChromeFirefox (Gecko)Internet ExplorerOperaSafari (WebKit)
Basic support1.0{{ CompatGeckoDesktop('1.8') }}{{ CompatIE('9.0') }}{{ CompatOpera('8.0') }}{{ CompatSafari('3.0.4') }}
+
+ +
+ + + + + + + + + + + + + + + + + + + +
FeatureAndroidFirefox Mobile (Gecko)IE PhoneOpera MobileSafari Mobile
Basic support{{ CompatAndroid('3.0') }}{{ CompatGeckoMobile('1.8') }}{{ CompatNo() }}{{ CompatVersionUnknown() }}{{ CompatSafari('3.0.4') }}
+
+ +

该表格基于这些资源

-- cgit v1.2.3-54-g00ecf