无法将笔画添加到svg圆元素

问题描述 投票:0回答:1

我在jsx中有一个图标:

    <svg xmlns="http://www.w3.org/2000/svg" width="21" height="22" viewBox="0 0 21 22">
      <g
        fill="none"
        fillRule="evenodd"
        stroke="#8D939B"
        strokeLinecap="round"
        strokeWidth="2"
        transform="translate(-17 -11) translate(18 12)"
      >
        <circle stroke="#8D939B" cx="8.5" cy="8.5" r="8.5" strokeLinejoin="round" />
        <path fillRule="nonzero" d="M14 19l5-5" transform="rotate(90 16 17)" />
      </g>
    </svg>

也有用于悬浮的css:

.menuContainer :global(.ant-menu-submenu-title:hover circle),
.menuContainer :global(.ant-menu-submenu-title:hover path) {
  stroke: #03ddac !important;
}

但没有将笔划添加到悬停时circle上的图标path元素中。

enter image description here

html css reactjs
1个回答
0
投票

stroke-width

是SVG的属性。尝试使用stroke-width而不是strokeWidth。另外,请确保您的浏览器支持嵌入式SVG。
© www.soinside.com 2019 - 2024. All rights reserved.