The <svg> Element

Each SVG document or document fragment must have as its containing element the element root, a <svg> element. The <svg> element usually contains width and height attributes, which define the width and height of the SVG image. If no width or height is specified, the width and height are both assumed to be 100 percent of the available browser window.

NOTE

The area defined by the <svg> element is the SVG initial viewport. Conceptually, it is a rectangular area through which you can view what is displayed on an area of the infinite SVG canvas. The width and height attributes define its dimensions. On an outer <svg> element, the default values of the x and y attributes (which define the position of the upper-left corner of the viewport) ...

Get Designing SVG Web Graphics now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.