How to resize SVG?

I have a code like this:

  <span>
     <svg height="32" version="1.1" width="32" xmlns="http://www.w3.org/2000/svg" style="overflow: hidden; position: relative; left: -0.0166626px; top: -0.983337px;">
        <desc></desc>
        <defs/>
        <path style="" fill="#333333" stroke="none" d="M15.985,5.972C8.422,5.972,2.289999999999999,10.049,2.289999999999999,15.078C2.289999999999999,17.955,4.302999999999999...............1,27.68,22.274Z"/>
      </svg>&nbsp;
  </span>

I cut out most of the content and replaced it with ...

The 32 by 32 icon is currently being created. I would like to know if I can use this code to create a 100 by 100 icon? I tried changing the width and height, but that didn't matter.

+5
source share
1 answer

The attributes widthand heightin the SVG element determine the size of the drawing area. They do not scale the content to fit this area. For this you also need to use the attribute viewBox:

<svg viewBox="0 0 32 32" height="100" width="100" ...>

viewBox , SVG. , .

preserveAspectRatio, , , .

+12

All Articles