how to make svg responsive

前端 未结 2 705

I\'m trying to make this massive svg responsive. However, it\'s not working and I don\'t know why.

I tried the following: - setting width: 100% height: auto (the dia

2条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-10 23:23

    Contrary to the assumptions in the comments it is perfectly fine to use length values specified as percentages. The spec covers the details in its basic data types section.

    Combining this knowledge with the hints from the article you linked to in your question you could end up with something like the following for a responsive layout:

    
    

提交回复
热议问题