svg rect 渲染问题

<svg style="width:1000px; height:100px" viewBox="0 0 1000 40">
    <rect  x="20%" y="0" height='40' width='60%'  rx="15" ry="15" fill='red'/>
    <!-- <text x="0" y="0" fill="red" font-size='30' height='40' width='20%'>I love SVG</text> -->
    <!-- <circle cx="200" cy="200" r="200" fill="#fdd" stroke="none"></circle> -->
    <text x="80%" y="0" fill="red" font-size='30' height='40' width='20%'>I love SVG</text>

  </svg>

渲染效果如图:
微信截图_20200521164112.png
为什么矩形和文字不是一排的?

阅读 1.4k
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题