links to this page:    
View this PageEdit this PageUploads to this PageHistory of this PageTop of the SwikiRecent ChangesSearch the SwikiHelp Guide
SVG coordinate system, viewport and viewbox
Last updated at 3:13 pm UTC on 20 October 2020
coordinate system

The viewport is set through height and width attributes within the <svg>.

The viewport is the visible section of an SVG. While an SVG can be as wide or as high as we wish, only a certain section of this image can be visible at a time.

and viewbox
The viewBox is an attribute of the element
The viewBox attribute defines the position and dimension, in user space, of an SVG viewport.

viewport: "a porthole window through which you can see the world beyond"

viewbox: "The viewBox can be thought of as much like the viewport but with two extra features: it can “pan” and it can “zoom”. Building on the “looking through glass” analogy, if the viewport is like a window, the viewBox is like a telescope."


For an example of a viewbox definition see SVG minimal document - LODraw export