首页 > 解决方案 > 从 CSS 文件中的圆形和文本元素编写样式

问题描述

我有一个将 xcircletexty 坐标设置为 50% 的元素。我想在 CSS 文件而不是 JS 文件中写坐标,但我找不到等价物,我只得到position, background-position-yorbackground-position-x但不是position-xorposition-y

我注意到在元素中坐标的写法不同

    <svg height="24" width="24">
     <circle className="application-count" cx="50%" cy="50%" r="12">
     </circle>//Here the coordinates are written as cx and cy
     <text x="50%" y="50%" text-anchor="middle" dy=".4em">{company.applicationCount}
     </text>//Here the coordinates are written as x and y
    </svg>

CSS 文件接受filltext-anchor不接受辐射或坐标

标签: javascriptcsssvg

解决方案


推荐阅读