Skip to main content

🗓️ 15022025 2253
📎

svg_foundations

current_color

viewbox

  • Allows for responsive design
  • Definition
    1. The x coordinate of the top-left point of the visible region;
    2. The y coordinate of the top-left point of the visible region;
    3. The width of the visible region in user units, and;
    4. The height of the visible region in user units.

aspect ratio

  • The viewbox determines the SVG's default aspect ratio
  • When the SVG's height and width don't match the viewbox's aspect ratio, the browser will scale the viewbox as necessary to fit it into the available space
  • The preserveAspectRatio attribute can be used to change this behavior

References