Html fa fa图标不与#标记_选择器*{u CSS}一起使用
我有一个覆盖CSS,在样式标签如下Html fa fa图标不与#标记_选择器*{u CSS}一起使用,html,css,css-selectors,font-awesome,css-specificity,Html,Css,Css Selectors,Font Awesome,Css Specificity,我有一个覆盖CSS,在样式标签如下 #主要内容*{ 字体系列:“Lucida Sans”,“Lucida Sans Regular”,“Lucida Grande”,“Lucida Sans Unicode”,日内瓦,Verdana,Sans serif!重要信息; 字体大小:小!重要; } 一些头衔 社交: 尝试重新定义 i.fa { font-family: FontAwesome!important; } 这应该在*{}定义之后 说明: 您可以强制将font Lucida分配
#主要内容*{
字体系列:“Lucida Sans”,“Lucida Sans Regular”,“Lucida Grande”,“Lucida Sans Unicode”,日内瓦,Verdana,Sans serif!重要信息;
字体大小:小!重要;
}
一些头衔
社交:
尝试重新定义
i.fa {
font-family: FontAwesome!important;
}
这应该在*{}
定义之后
说明:
您可以强制将font Lucida分配给所有元素,但font awesome需要font family:FontAwesome
同样,如果一个样式在另一个样式之后出现,那么如果它们具有相同的重要性,则可能会覆盖它。尝试重新定义
i.fa {
font-family: FontAwesome!important;
}
这应该在*{}
定义之后
说明:
您可以强制将font Lucida分配给所有元素,但font awesome需要font family:FontAwesome
另外,如果具有相同的重要性,在另一个样式之后出现的相同样式也可以覆盖它。您还可以在当前定义中设置排除CSS选择器
(:not)
。
它还将从为#MainContent
中的元素分配Font-size:small
中排除Font-Awesome
例如:
/**
*设置为#MainContent中的所有元素
*@除:.fa(方太棒)
*/
#主内容*:非(.fa){
字体系列:“Lucida Sans”,“Lucida Sans Regular”,“Lucida Grande”,“Lucida Sans Unicode”,日内瓦,Verdana,Sans serif!重要信息;
字体大小:小!重要;
}
您还可以在当前定义中设置排除CSS选择器(:not)
。
它还将从为#MainContent
中的元素分配Font-size:small
中排除Font-Awesome
例如:
/**
*设置为#MainContent中的所有元素
*@除:.fa(方太棒)
*/
#主内容*:非(.fa){
字体系列:“Lucida Sans”,“Lucida Sans Regular”,“Lucida Grande”,“Lucida Sans Unicode”,日内瓦,Verdana,Sans serif!重要信息;
字体大小:小!重要;
}
您可以使用此选项覆盖常规设置:
#MainContent * {
font-family: 'Lucida Sans', 'Lucida Sans Regular', 'Lucida Grande', 'Lucida Sans Unicode', Geneva, Verdana, sans-serif !important;
font-size: small !important;
}
#MainContent * .fa {
font-family: FontAwesome !important;
}
但是,在您的特定情况下,这也不会真正起作用:您的一些文本(“Twitter页面”、“LinkedIn页面”)位于带有classfa
的标记的范围内,因此这些单词将显示为
因此,您必须添加第三条类似的规则,以覆盖这些跨距的fa
字体设置:
#MainContent * .fa > span {
font-family: 'Lucida Sans', 'Lucida Sans Regular', 'Lucida Grande', 'Lucida Sans Unicode', Geneva, Verdana, sans-serif !important;
font-size: small !important;
}
您可以使用此选项替代常规设置:
#MainContent * {
font-family: 'Lucida Sans', 'Lucida Sans Regular', 'Lucida Grande', 'Lucida Sans Unicode', Geneva, Verdana, sans-serif !important;
font-size: small !important;
}
#MainContent * .fa {
font-family: FontAwesome !important;
}
但是,在您的特定情况下,这也不会真正起作用:您的一些文本(“Twitter页面”、“LinkedIn页面”)位于带有classfa
的标记的范围内,因此这些单词将显示为
因此,您必须添加第三条类似的规则,以覆盖这些跨距的fa
字体设置:
#MainContent * .fa > span {
font-family: 'Lucida Sans', 'Lucida Sans Regular', 'Lucida Grande', 'Lucida Sans Unicode', Geneva, Verdana, sans-serif !important;
font-size: small !important;
}
abc和def有什么?该代码不应影响它。abc和def有什么功能?那个代码不应该影响我,老兄,谢谢,我也有同样的问题,几乎决定不再使用它,因为我看不到问题。哦,老兄,谢谢,我也有同样的问题,几乎决定不再使用它,因为我看不到问题。