SVG as Image in Mozilla

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

SVG as Image in Mozilla

Natarajan Thanikachalam
Hi,

As I understand, Mozilla renders SVG as a document, rather than as an
Image, given this, can you please help me on

1) How do I get to know the dimensions of an SVG (doc/image)?
2) How do I scale an SVG (doc/image)?

Many Thanks for your help in advance,
Kind Regards,

Natarajan.
_______________________________________________
dev-tech-svg mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-svg
Reply | Threaded
Open this post in threaded view
|

Re: SVG as Image in Mozilla

Jeff Schiller
The point of SVG is to have truly scalable images.  The SVG image
itself may not have explicit dimensions.

The <svg> element gets a width/height attributes so you can set those
explicitly.  These attributes default to 100% though so you can also
set the containing element to the size you want and the image will
scale to it.

If you want to scale an SVG image, you can remove the explicit width/
height  (so they default to 100%) and then scale the containing
element (the <div> in an inline case or the <object> in a referenced-
SVG case).  You can also change the value of the viewBox attribute on
the <svg> element to change the scale and position of the image.

HTH,
Jeff Schiller

On Jul 26, 4:16 am, Natarajan Thanikachalam
<[hidden email]> wrote:

> Hi,
>
> As I understand, Mozilla renders SVG as a document, rather than as an
> Image, given this, can you please help me on
>
> 1) How do I get to know the dimensions of an SVG (doc/image)?
> 2) How do I scale an SVG (doc/image)?
>
> Many Thanks for your help in advance,
> Kind Regards,
>
> Natarajan.

_______________________________________________
dev-tech-svg mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-svg