<view>

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

Usage context

CategoriesNone
Permitted contentAny number of the following elements, in any order:
Descriptive elements

Attributes

Global attributes

Specific attributes

Example

SVG

<svg width="600" height="200" viewBox="0 0 600 200"
    xmlns="http://www.w3.org/2000/svg"
    xmlns:xlink="http://www.w3.org/1999/xlink">
  <defs>
    <radialGradient id="gradient">
      <stop offset="0%" stop-color="#8cffa0" />
      <stop offset="100%" stop-color="#8ca0ff" />
    </radialGradient>
  </defs>

  <circle r="50" cx="180" cy="50" style="fill:url(#gradient)"/>

  <view id="halfSizeView" viewBox="0 0 1200 400"/>
  <view id="normalSizeView" viewBox="0 0 600 200"/>
  <view id="doubleSizeView" viewBox="0 0 300 100"/>

  <a xlink:href="#halfSizeView">
    <text x="5" y="20" font-size="20">half size</text>
  </a>
  <a xlink:href="#normalSizeView">
    <text x="5" y="40" font-size="20">normal size</text>
  </a>
  <a xlink:href="#doubleSizeView">
    <text x="5" y="60" font-size="20">double size</text>
  </a>
</svg>

HTML

<object data="data:image/svg+xml;charset=utf-8;base64,PHN2ZyB3aWR0aD0iNjAwIiBoZWlnaHQ9IjIwMCIgdmlld0JveD0iMCAwIDYwMCAyMDAiDQogICAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIg0KICAgIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIj4NCiAgPGRlZnM%2BDQogICAgPHJhZGlhbEdyYWRpZW50IGlkPSJncmFkaWVudCI%2BDQogICAgICA8c3RvcCBvZmZzZXQ9IjAlIiBzdG9wLWNvbG9yPSIjOGNmZmEwIiAvPg0KICAgICAgPHN0b3Agb2Zmc2V0PSIxMDAlIiBzdG9wLWNvbG9yPSIjOGNhMGZmIiAvPg0KICAgIDwvcmFkaWFsR3JhZGllbnQ%2BDQogIDwvZGVmcz4NCg0KICA8Y2lyY2xlIHI9IjUwIiBjeD0iMTgwIiBjeT0iNTAiIHN0eWxlPSJmaWxsOnVybCgjZ3JhZGllbnQpIi8%2BDQoNCiAgPHZpZXcgaWQ9ImhhbGZTaXplVmlldyIgdmlld0JveD0iMCAwIDEyMDAgNDAwIi8%2BDQogIDx2aWV3IGlkPSJub3JtYWxTaXplVmlldyIgdmlld0JveD0iMCAwIDYwMCAyMDAiLz4NCiAgPHZpZXcgaWQ9ImRvdWJsZVNpemVWaWV3IiB2aWV3Qm94PSIwIDAgMzAwIDEwMCIvPg0KDQogIDxhIHhsaW5rOmhyZWY9IiNoYWxmU2l6ZVZpZXciPg0KICAgIDx0ZXh0IHg9IjUiIHk9IjIwIiBmb250LXNpemU9IjIwIj5oYWxmIHNpemU8L3RleHQ%2BDQogIDwvYT4NCiAgPGEgeGxpbms6aHJlZj0iI25vcm1hbFNpemVWaWV3Ij4NCiAgICA8dGV4dCB4PSI1IiB5PSI0MCIgZm9udC1zaXplPSIyMCI%2Bbm9ybWFsIHNpemU8L3RleHQ%2BDQogIDwvYT4NCiAgPGEgeGxpbms6aHJlZj0iI2RvdWJsZVNpemVWaWV3Ij4NCiAgICA8dGV4dCB4PSI1IiB5PSI2MCIgZm9udC1zaXplPSIyMCI%2BZG91YmxlIHNpemU8L3RleHQ%2BDQogIDwvYT4NCjwvc3ZnPg%3D%3D" type="image/svg+xml"></object>

Result

DOM Interface

This element implements the SVGViewElement interface.

Specifications

Specification
Scalable Vector Graphics (SVG) 1.1 (Second Edition) (SVG)
# ViewElement

Browser compatibility

BCD tables only load in the browser