testing a simple page with some text and svg with a percentage of height and weight, I got extra space before and after svg. There is no extra space in Firefox, but you can find it in Safari and Chrome. You can see it here: http://www.venerandi.com/svg_space.xhtml
This is the svg code:
<svg id="uno" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 500 250" width="100%" height="100%" preserveAspectRatio="xMidYMid meet"> <polygon points="1, 20 500, 1 220, 250" style="fill:#FFFFFF; stroke:#000000;stroke-width:5"/> <text x="47" y="42" font-size="24" fill="red" font-weight="bold">Colombini Locusta</text> <text x="45" y="44" font-size="24" color="black" font-weight="bold">Colombini Locusta</text> <rect x="200" y="100" width="70" height="70" style="fill:red"/> </svg>
Some suggestion to understand why extra space is created?
Thanks.
source share