css无法正确显示

时间:2013-09-18 06:50:05

标签: css encoding

我有一个网页设计师制作的CSS,而且该css文件包含以下类:

    .icon-phone-alt:before {
        content: "\e064";
    }

在我的视图页面中,我有类似的内容:

<span class="icon-phone-alt"></span>&#160;Tel.: (+40 21) XXXXXXXX<br />

问题在于,而不是这样的事情:
enter image description here

我得到了这个:
enter image description here

我必须提到我的浏览器配置为utf8并且使用相同的浏览器正确显示原始html页面。我认为这与字符编码有关,但我不知道如何处理这种情况。

2 个答案:

答案 0 :(得分:1)

您必须使用图标范围的特殊字体,将图标显示为字符。例如:

<link rel="stylesheet" href="http://fortawesome.github.io/Font-Awesome/assets/font-awesome/css/font-awesome.css">
<span class="icon-phone"></span>&#160;Tel.: (+40 21) XXXXXXXX<br />

答案 1 :(得分:1)

也许您没有包含您的Glyphicons /特殊字体。

您应该先包含它们。试着看看这个实现:

<强> https://github.com/mdo/bsu/blob/master/step-4/bootstrap-less/glyphicons.less

相关问题