3

Here's the svg:

<svg width="40%" viewbox="0 0 30 42">
  <path fill="transparent" stroke="#000" stroke-width="1.5"
        d="M15 3
           Q16.5 6.8 25 18
           A12.8 12.8 0 1 1 5 18
           Q13.5 6.8 15 3z" />
</svg>

How to make this svg bigger? Here's the code: https://stackblitz.com/edit/angular-nnqwef?file=src/app/app.component.html

1 Answer 1

2

You need to set the viewBox (be careful, it's not viewbox) in order to scale changing with and height as you do.

Like in here:

<svg width="220" height="220" viewBox="0 0 50 100">
  <path id="scale" fill="transparent" stroke="#000" stroke-width="1.5"
        d="M15 3
           Q16.5 6.8 25 18
           A-22.8 -22.8 0 1 1 5 18
           Q13.5 6.8 15 3z" />
</svg>

<svg width="440" height="440" viewBox="0 0 50 100">
  <path id="scale2" 
        d="M15 3
          Q20.5 11.8 35 25
          A-28.8 -28.8 0 1 1 0 20
          Q13.5 6.8 15 3z" />
</svg>

https://stackblitz.com/edit/angular-4nylpq?file=src/app/app.component.html

and

https://stackblitz.com/edit/angular-jxc7nx?file=src/app/app.component.html

SVG with a viewBox will scale to fit the height and width you give it.

More info

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.