gpt4 book ai didi

css - 跨域中的 bootstrap glyphicons 不起作用

转载 作者:行者123 更新时间:2023-11-28 09:15:30 25 4
gpt4 key购买 nike

我有一个基本站点,其中包含我的所有代码 javascript 以及对 jquery 和 bootstrap 的依赖项,因此我不需要每次都将所有这些文件复制到新站点。例如,我的基本站点位于 localhost/basesite 上,因此新站点使用这样的 Bootstrap :

<link href="http://localhost/basesite/content/bootstrap/css/boostrap.css rel='stylesheet' />

对于脚本:

<script src='http://localhost/basesite/scripts/bootstrap.js'></script>

一切正常,但 bootstrap glyphicons 不行,因为 fonts 目录中的 3 个文件没有正确加载:

../fonts/glyphicons-halflings-regular.[woff, ttf, svg]

这些文件在bootstrap的fonts目录下,浏览器可以正确获取文件glyphicons-halflings-regular.eof,witch在同一个目录下。

如果我打开我的基本站点,glyphicon 就像一个魅力,所以字体目录位置没有问题。

我认为这是跨域的问题,但我的站点已经配置为使用它。

在 Chrome 中,我得到了 304 和 206。我真的无法理解。这是 Google Chrome 的打印屏幕:

Network tab from google chrome

Details from 206

Details from 304

最好的问候

最佳答案

似乎问题出在字体文件夹权限上,可能是字体请求返回 403 错误(禁止)并导致问题,再次调整权限和托盘,检查 google chrome 或 firebug 上的网络面板以获取更多信息关于这个问题,如果问题是 url 路径网络面板向您显示此错误,托盘将完整路径放入 url 字体中,如:http://www.yourdomain.com/folderpath/fontname ...

关于css - 跨域中的 bootstrap glyphicons 不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26318709/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com