How to make a <svg> element expand or contract to its parent container?

后端 未结 5 1862
日久生厌
日久生厌 2020-11-28 02:26

The goal is to have the element expand to the size of its parent container, in this case a

, no matter how big or small that
5条回答
  •  日久生厌
    2020-11-28 03:08

    What's worked for me recently is to remove all height="" and width="" attributes from the tag and all child tags. Then you can use scaling using a percentage of the parent container's height or width.

提交回复
热议问题