Glyphicon 显示不正确
Gylphicon not displaying correctly
如果我使用这个标记:
<span class="glyphicon glyphicon-resize-vertical"></span>
图标显示正常。
但是,如果我使用此 css 规则:
.section-header::after {
content:"\e119";
float: right;
padding-left: 1em;
}
它只显示通用的缺失字体方形图像。
在网上搜索它看起来其他人也有类似的问题,但这些问题似乎可以通过更正字形图标字体文件的位置来解决,但是我的位置完全正确,即相对于 css 它位于 ..\fonts\
还有什么问题?
您需要定义 font-family
,尝试以下 CSS
,它应该有效
.section-header::after {
content:"\e119";
float: right;
padding-left: 1em;
font family: Glyphicons Halflings;
}
像这样添加字体系列:Demo
.section-header::after {
font-family:'Glyphicons Halflings';
content:"\e119";
float: right;
padding-left: 1em;
}
如果我使用这个标记:
<span class="glyphicon glyphicon-resize-vertical"></span>
图标显示正常。 但是,如果我使用此 css 规则:
.section-header::after {
content:"\e119";
float: right;
padding-left: 1em;
}
它只显示通用的缺失字体方形图像。
在网上搜索它看起来其他人也有类似的问题,但这些问题似乎可以通过更正字形图标字体文件的位置来解决,但是我的位置完全正确,即相对于 css 它位于 ..\fonts\
还有什么问题?
您需要定义 font-family
,尝试以下 CSS
,它应该有效
.section-header::after {
content:"\e119";
float: right;
padding-left: 1em;
font family: Glyphicons Halflings;
}
像这样添加字体系列:Demo
.section-header::after {
font-family:'Glyphicons Halflings';
content:"\e119";
float: right;
padding-left: 1em;
}