繁体   English   中英

如何解决webfont问题

[英]how to solve webfont problems

我在具有CDN链接的项目中使用Bootstrap.css和font-awesome.css。 例如:对于bootstrp

<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootswatch/3.3.0/cerulean/bootstrap.min.css">

对于字体很棒

 <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">

在我的代码中,我使用class =“ glyphicon glyphicon-search”等。 但是当我从相同的链接分别下载css文件时。 并在本地添加依赖项,使其无法运行。 错误说

 GET http://localhost:8451/ProntoDemo/resources/fonts/glyphicons-halflings-regular.woff 
 GET http://localhost:8451/ProntoDemo/resources/fonts/glyphicons-halflings-regular.ttf 404 (Not Found)

我不明白问题是什么。 请帮助我在本地运行。 喜欢

<link rel="stylesheet" href="./resources/css/bootstrap.min.css">

由于字体文件是捆绑提供的,因此它们具有包含字体的ttf(真型字体)文件。 因此,您需要下载zip并将其解压缩到服务器,然后才可以链接css文件。

<link rel="stylesheet" href="Fonts/font-awesome-4.4.0/css/font-awesome.min.css">

链接https://fortawesome.github.io/Font-Awesome/

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM