javascript - 从 CSS 文件中的圆形和文本元素编写样式
问题描述
我有一个将 xcircle
和text
y 坐标设置为 50% 的元素。我想在 CSS 文件而不是 JS 文件中写坐标,但我找不到等价物,我只得到position
, background-position-y
orbackground-position-x
但不是position-x
orposition-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 文件接受fill
但text-anchor
不接受辐射或坐标
解决方案
推荐阅读
- reactjs - 打字稿RefForwardingComponent不起作用
- django - 我想创建一个 url,将链接指向我在 django 中的视图中的登录功能 我尝试了一切,但没有成功
- php - 使用 memcache 和 php 7 进行会话故障转移
- javascript - 为什么 asm.js 比普通 js 慢(生成素数)?如何加快速度?
- javascript - Vis js - 避免边缘重叠
- python - 如何在十六进制 Linux 终端中发送参数
- c++ - 从不同线程推送到队列时出现分段错误
- bootstrap-4 - 升级到引导程序 4 后,可选项卡窗格在 IE 11 中停止工作
- google-maps - 根据坐标创建 Google 地图链接 - 错误引脚位置
- flutter - Flutter:从子 StreamBuilder 更新有状态小部件