html - 自定义字体不会出现在页面 hostgator 中

标签 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">

最佳答案

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

关于html - 自定义字体不会出现在页面 hostgator 中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24517378/

相关文章:

javascript - 使用 jQuery 捕获和冒泡

html - 为什么这些图像之间有空格?

html - 字体很棒的图标不起作用

html - 使用@Font-Family 时不显示 TTF 字体

html - 使用 float 元素扩展垂直空间问题

javascript - 未捕获的类型错误 : undefined is not a function when using highcharts

html - 用于中心对齐导航的内联 block 在 IE 11+ 中不显示水平

html - 自定义复选框状态不会在 Bootstrap 崩溃时更新

asp.net - Silverlight 网站浏览器缩放问题

c++ - 如何加载同一家族的多种字体