我正在使用谷歌的material 图标.
字体按如下方式导入:
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded&display=block:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200" />
然后是一个css类:
.material-symbols-rounded {
font-variation-settings:
'FILL' var(--fill-icons),
'wght' 300,
'GRAD' 200
}
我有一些li元素,我想更改默认的list-style-type
,并将‘Disk’替换为material 图标,例如folder
(代码点:e2c7
).
我目前有这个:
li::marker {
font-family: 'Material Icons Rounded';
content: "\e2c7";
color: white;
display: inline-block;
margin-right: 6px;
}
我还try 使用::before
伪元素,并使用连字而不是代码点.
它为什么要这么做?我可以做些什么来让它工作?
使用Chrome 114