SVG Basics

What is SVG?

  • The svg tag itself is the canvas or “viewport” through which the graphic is viewed.
  • Don’t set the height and width parameters in the svg tag, use the viewBox attribute instead.
  • The value of the viewBox attribute is a list of four numbers:
    min-x
    min-y
    width
    height
  • The viewBox can be thought of as adding two extra features: “pan” and “zoom” to the viewport.