自定义图标字体显示在我的localhost环境中,但不显示在我的外部服务器上

时间:2017-12-20 16:51:23

标签: css fonts font-awesome glyphicons

总结:我有一个问题,我的网站中包含的自定义字体(在Glypther中生成)将在我的localhost上呈现/显示。但是当网站移动到我的托管服务提供商时,它根本不会呈现/显示。

这是生成的iconfont.css文件(使用的是.icon-logo)。生成的其他文件我没有包含在内。

@font-face {
    font-family: 'IconFont';
    src: url('../fonts/IconFont.eot');
    src: url('../fonts/IconFont.eot?#iefix') format('embedded-opentype'),
         url('../fonts/IconFont.woff') format('woff'),
         url('../fonts/IconFont.ttf') format('truetype'),
         url('../fonts/IconFont.svg#IconFont') format('svg');
    font-weight: normal;
    font-style: normal;
}
[class*='icon-']:before{
    display: inline-block;
   font-family: 'IconFont';
   font-style: normal;
   font-weight: normal;
   line-height: 2;
   font-size: 2.3em;
   -webkit-font-smoothing: antialiased;
   -moz-osx-font-smoothing: grayscale
}
.icon-Block:before{content:'\0041';}
.icon-Chat:before{content:'\0042';}
.icon-Favorite:before{content:'\0043';}
.icon-Interested:before{content:'\0044';}
.icon-Unlock:before{content:'\0045';}
.icon-Wink:before{content:'\0046';}
.icon-Logo:before{content:'\0047';} 

css(style.css)中有一些样式并使用bootstrap:

.navbar-inverse .icon-Logo {
    float: left;
    padding-right: 5px;
    padding-left: 5px;
    color: #fff;
}

.navbar-default.lo-nav .icon-Logo {
    color: #525252;
    float: left;
    padding-left: 5px;
}

以下是使用徽标的代码:

<i class="icon icon-Logo"></i>
<a class="navbar-brand" href="index.php">Website name</a>

当我检查代码(使用Chrome)时,logo正确显示在localhost上,我看到以下内容:

<i class="icon icon-Logo>
  ::before
</i> == $0

但是,在检查外部主机上的代码时(没有显示徽标),我看到以下内容:

<i class="icon icon-Logo></i>

唯一要提及的另一件事我不确定它是否相关是我的外部主机(HG)URL是一个附加域(DNS尚未更新,即我使用http访问该站点: /(accountname)/ website /我使用Chrome vHost扩展。我之所以认为这是相关的,是因为在本地和外部托管条件下都有其他图标字体包含(由其他人添加) 。

我很感激任何见解。谢谢!

0 个答案:

没有答案