× {{alert.msg}} Never ask again
Get notified about new tutorials RECEIVE NEW TUTORIALS

Webkit seems to have a problem sizing SVGs in divs unless their size is explicitly defined

Sam Millman
Nov 13, 2015
<p>It was found on session that despite what the web tools in Chrome was telling us, that the SVGs on the page were the same size, the SVGs in reality, when displayed, were not.</p> <p>The size of these SVGs was defined by the divs around them, so that the SVG itself had a style of 100% width and height of it's outer div.</p> <p>Some where big and some were small.</p> <p>This was quickly fixed by hard coding the SVG div size. After that Chrome and Safari displayed the SVGs in their correct size.</p>
comments powered by Disqus