Default background color of SVG root element

SVG 1.2 Tiny has viewport-fill I’m not sure how widely implemented this property is though as most browsers are targetting SVG 1.1 at this time. Opera implements it FWIW.

A more cross-browser solution currently would be to stick a <rect> element with width and height of 100% and fill=”red” as the first child of the <svg> element, for example:

<rect width="100%" height="100%" fill="red"/>

Leave a Comment