css - MaterialIcons-Regular 应用任何 CSS *:first-letter 时的字体错误
问题描述
如果我在此选择器上应用任何 CSS 规则,而在 Chrome 上,我的 MaterialIcons-Regular 图标会消失或爆炸成两个不同的图标。
*:first-letter {
color: #000
}
关于这里可能有什么问题的任何想法?
想看看我的意思吗?在 Firefox 和 Chrome 中打开的链接: https ://jsfiddle.net/z7xmf81u/
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
</head>
<style>
*:first-letter {color: blue;}
h1 {color: blue;}
p {color: red;}
</style>
<body>
<p>test</p>
<i class="material-icons">cloud</i>
<i class="material-icons" style="font-size:48px;">cloud</i>
<i class="material-icons" style="font-size:60px;color:red;">cloud</i>
<i class="material-icons" style="font-size:60px;color:red;">network_check</i>
</body>
</html>
你可以删除
*:首字母{颜色:蓝色;}
随意行。
任何解决方法表示赞赏,谢谢
解决方案
嗯...这似乎是因为这是一种连字字体。
当应用这个伪元素cloud
时"cloud"
,它在 Mat-icons 中没有等价物。同样地network_check
,"network_check"
有可能并且确实有MI等价物。也许可能有效?network
check
*:not(.material-icons)
*:not(.material-icons):first-letter {
color: blue;
}
h1 {
color: blue;
}
p {
color: red;
}
<head>
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
</head>
<body>
<p>test</p>
<i class="material-icons">cloud</i>
<i class="material-icons" style="font-size:48px;">cloud</i>
<i class="material-icons" style="font-size:60px;color:red;">cloud</i>
<i class="material-icons" style="font-size:60px;color:red;">network_check</i>
</body>
推荐阅读
- microsoft-graph-api - Microsoft Graph API 获取与内容类型关联的列列表
- node.js - 是否有将 csv 数据导入 mongodb 的 npm 包或 express 内置函数?
- javascript - 从简单数组创建嵌套对象
- javascript - Node.js:使用 excel 获取 + 管道不起作用
- cassandra - 什么可能导致 cassandra 中出现“幽灵”表名?
- javascript - 如何在反应应用程序中使用 i18next 和反应路由器 dom 修补链接?
- c# - 对象集合上的 HashSet
- python - 如何防止功能在鼠标单击时运行,直到上一个完成
- arrays - 在复制活动中使用 JArrays - Azure 数据工厂
- sql - 根据mysql中的另一个活动获取行