Re: Why do some SVG scale and others don't?

On Tue, 19 Feb 2002, Peter Sheerin wrote:

> I've come across a few sample SVG images that, when viewed directly in a browser, appear to be the same size (say 100px) no matter how wide the browser is, and other SVG images that stretch to the entire width, maintaining their aspect ratio.
> 
> Looking at the source, I can find no clear differentiator between these two appearances. How do I modify a fixed-size SVG image to scale automatically?

The standard way is to use the viewBox attribute. If I don't
want to specify an exact size I usually do something like this.

<svg width="100%" height="100%" viewBox="0 0 500 500">

Received on Tuesday, 19 February 2002 20:47:04 UTC