自定义字体不会显示在页面hostgator中

时间:2014-07-01 18:54:34

标签: html css fonts ftp styles

嗨我的字体有问题。我已经在线下载了自定义字体(http://www.fontsquirrel.com/),我希望它出现在我的页面上。当我尝试将其上传到不同的ftp服务器上时,它工作得非常好但是当我尝试在hostgator中上传它时,它不会显示出来。我试图在不同的ftp服务器上传我的网站,一切正常,只是当我尝试在hostgator上传它时,字体不会出现。我上传了单独的css文件,它看起来像这样:

@font-face {
font-family: 'quicksandregular';
src: url('../font/Quicksand/quicksand-regular-webfont.eot');
src: url('../font/Quicksand/quicksand-regular-webfont.eot?#iefix') format('embedded-opentype'),
     url('../font/Quicksand/quicksand-regular-webfont.woff') format('woff'),
     url('../font/Quicksand/quicksand-regular-webfont.ttf') format('truetype'),
     url('quicksand-regular-webfont.svg#quicksandregular') format('svg');
font-weight: normal;
font-style: normal;

}

和样式css:

#about p.content a, #works p.content a, #preloader p.content a {
color: #ffffff;
font: 17px 'Quicksandregular';
text-decoration: underline;

}

和我的索引页面:

<link rel="stylesheet" media="all" href="css/quicksand.css">

1 个答案:

答案 0 :(得分:0)

按F12并检查您的字体资源是否已加载。如果他们没有,你应该有类似enter image description here但有5个而不是1个错误。 另外,在style.css文件中将font: 17px 'Quicksandregular';替换为font-family: 'Quicksandregular';font-size: 17px;,并检查问题是否仍然存在。你的语法也是正确的,但只是为了确定。 仔细检查您的文件路径,确保您没有忘记任何事情。