I have this code
<svg width="325" height="250" viewBox="20 40 2 555" style="outline: 1px solid #666;">
<path data-map-id="1" style="fill: #d9534f" class="st3" d="M345.1,302.4V276c0-3.5,2.8-6.3,6.3-6.3h20.3v32.7H345.1z"/>
</svg>
I want this to appear much larger by %200. I read and tried several, what seems to be solutions, but I can’t seem to get it it work. The goal is, when the user selects this ‘block’ the path is generated onto another page, but I need to increase the size – seems smple enough…right? Any help would be much appreciated.
I tried manipulating the width and height using css and inline style, but to no avail
2
Answers
Try these:
Set the missing viewbox and fill in the height and width values of
the set height and height attributes in the svg tag
Then scale the picture simply by setting the height and width to the
desired percent values. Good luck.
Set a fixed aspect ratio with preserveAspectRatio="X200Y200 meet
(e.g. 200px), but it’s not necessary
Just a Smop (Small matter of programming)
Now you did not give quite enough ground rules as to MWE (Minimal Working Exception)
Lets try to enlarge the source blob 200% to make the green one, and here is the correct way with those untold assumptions that
(but note I had to push the envelope out 5 units to the right, to keep in viewport)
However the simplest since we have a scalable object is scale up by 2 using a transform, and adjust viewport to suit.