view

Baseline Widely available *

This feature is well established and works across many devices and browser versions. It’s been available across browsers since January 2020.

* Some parts of this feature may have varying levels of support.

Uma view é uma maneira definida de visualizar a imagem, como um nível de zoom ou uma visualização de detalhes.

Usage context

CategoriasNenhum
Conteúdo permitidoQualquer número dos seguintes elementos, em qualquer ordem:
Elementos descritivos

Attributes

Global attributes

Specific attributes

Example

SVG

html
<svg
  width="600"
  height="200"
  viewBox="0 0 600 200"
  xmlns="https://www.w3.org/2000/svg"
  xmlns:xlink="https://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>

Result

DOM Interface

This element implements the SVGViewElement interface.

Specifications

Specification
Scalable Vector Graphics (SVG) 2
# ViewElement

Compatibilidade com navegadores

Report problems with this compatibility data on GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
view
preserveAspectRatio
viewBox
zoomAndPan
DeprecatedNon-standard

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
Non-standard. Check cross-browser support before using.
Deprecated. Not for use in new websites.