How to hold SVGs small in pure HTML view?

56 views Asked by At

When I view a html page with SVG files without CSS, embedded SVGs are expanded to the full viewport of browser, too big. Is it a way to hold SVG small in HTML view?

Maybe only

 <svg width="50" height="50"> 

?

1

There are 1 answers

0
Tim On

Yes, you can scale SVGs using the width and height HTML attributes like this:

<svg width="50" height="25">

SVG also provides a number of other attributes like viewbox and preserveAspectRatio to help you manage size, position, and scale. Check out this article on CSS-Tricks for more info.