SVG only shown partially in Firefox

后端 未结 1 1537
别跟我提以往
别跟我提以往 2021-01-23 23:23

I\'m currently working with a Swiss map in SVG format. The tag is directly embedded inside a

.

In Chromium (Linux), ever

相关标签:
1条回答
  • 2021-01-23 23:48

    You should set height and width to your parent div and then set the svg both height and width to 100%:

    HTML:

    <div id="map" style="height: 500px;width:600px;">
    

    SVG:

    <svg
       xmlns:svg="http://www.w3.org/2000/svg"
       xmlns="http://www.w3.org/2000/svg"
       version="1.0"
       id="svg_main" style="height: 100%;width: 100%">
    

    Check this code: http://jsfiddle.net/Kgs6J/

    0 讨论(0)
提交回复
热议问题