我正在寻找在 Symfony 中包含来自 CSS 文件的字体。问题是浏览器无法加载这些字体。
@font-face {
font-family: 'Corbert'; /*a name to be used later*/
src: url('fonts/Corbert-Regular.otf') format('opentype'),
url('fonts/Corbert-Regular.woff') format('woff'),
url('fonts/Corbert-Regular.ttf') format('truetype');
}
我的路径结构是
...
+-src/
| +-MyCompany/
| +-MyBundle/
| +-Resources/
| +-public/
| +-css/
| +-fonts/
我链接CSS文件的路径是
path linking CSS http://img11.hostingpics.net/pics/602795Capture.png
fonts http://img11.hostingpics.net/pics/302550Capture.png
我做错了什么?
最佳答案
看起来好像您没有将字体文件包含到字体文件夹中..?
在您编辑原始问题之后:
您需要在引导之前包含 jQuery 库。 您可以从 jquery.com 下载它或仅链接到在线版本。
最后它应该看起来像这样的例子:
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script src="js/bootstrap.min.js"></script>
关于css - Symfony 2 CSS 文件中的@font-face 规则,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28984280/