I have a issue specific to Webkit browsers (Safari & Chrome, on Mac & PC).
I\'m using Raphael JS to render SVG data and using a responsive layout to scale th
It's hard for me to understand exactly what you want with your example, or what is not as you intend it. However, in general, if you are using a layout with percentage widths and height containers and you want content to fill those containers, you need to take them out of the flow (using position:absolute
on the content and position:relative
or position:absolute
on the containers).
Here's a simple example that works find in Chrome and Safari:
http://phrogz.net/SVG/size-to-fill.xhtml
The #foo
div has its height and width as a percentage of the body. It has a red background that will never be seen because the SVG is position:absolute
inside it and set to fill it completely, and have a green background. If you ever see red, it is an error.
#foo, svg { position:absolute }
#foo { left:20%; width:30%; top:5%; height:80%; background:red; }
svg { top:0; left:0; width:100%; height:100%; background:green; }