<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.

Un view es una forma definida de ver la imagen, con un nivel de zoom o una vista detallada.

Contexto de uso

CategoriasNinguna
Contenido permitidoCualquier número de los siguientes elementos, en cualquier orden:
Elementos descriptivos

Atributos

Atributos globales

Atributos específicos

Ejemplo

SVG

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

html
<img src="example.svg" alt="tres círculos" width="300" height="100" />
<br />
<img src="example.svg#three" alt="círculo azul" width="100" height="100" />

Resultado

Interfaz DOM

Este elemento implementa la interfaz <SVGViewElement>.

Especificaciones

Specification
Scalable Vector Graphics (SVG) 2
# ViewElement

Compatibilidad con 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.