<view>

A view is a defined way to view the image, like a zoom level or a detail view.

Usage context

类别 None
准许内容 Any number of the following elements, in any order:
Descriptive elements

属性

全局属性

Specific attributes

范例

SVG

<svg viewBox="0 0 300 100" width="300" height="100"
      xmlns="http://www.w3.org/2000/svg">
  <view id="one" viewBox="0 0 100 100" />
  <circle cx="50" cy="50" r="40" fill="red" />
  <view id="two" viewBox="100 0 100 100" />
  <circle cx="150" cy="50" r="40" fill="green" />
  <view id="three" viewBox="200 0 100 100" />
  <circle cx="250" cy="50" r="40" fill="blue" />
</svg>

					

HTML

<img src="example.svg" alt="three circles" width="300" height="100" />
<br />
<img src="example.svg#three" alt="blue circle" width="100" height="100" />

					

结果

DOM Interface

This element implements the SVGViewElement 接口。

规范

规范
Scalable Vector Graphics (SVG) 1.1 (Second Edition) (SVG)
# ViewElement

浏览器兼容性

BCD tables only load in the browser

Found a problem with this page?

最后修改: , 由 MDN 贡献者