【问题标题】:Bootstrap working on chrome but not on firefox?Bootstrap 在 chrome 上工作,但在 Firefox 上不工作?
【发布时间】:2016-04-11 13:42:11
【问题描述】:

您好,我正在为朋友建立一个网站,该网站在 chrome 上看起来不错,但是当我尝试在 Firefox 上对其进行测试时,它看起来与 chrome 版本完全不同。查看 Firefox 的调试器,似乎引导 css 没有从 CDN 加载。任何提示将不胜感激!这是我调用引导 CDN 的代码部分。

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link href='https://fonts.googleapis.com/css?family=Open+Sans:400,300,600' rel='stylesheet' type='text/css'>
  <script src="https://use.typekit.net/edr3ydd.js"></script>
  <script>try{Typekit.load({ async: true });}catch(e){}</script>
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" integrity="sha512-dTfge/zgoMYpP7QbHy4gWMEGsbsdZeCXz7irItjcC3sPUFtf0kuFbDz/ixG7ArTxmDjLXDmezHubeNikyKGVyQ==" crossorigin="anonymous">
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap-theme.min.css" integrity="sha384-aUGj/X2zp5rLCbBxumKTCw2Z50WgIr1vs/PFN4praOTvYXWlVyh2UtNUU0KAUhAX" crossorigin="anonymous">
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css">
  <link rel="stylesheet" type="text/css" href="css\about.css">
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js" integrity="sha512-K1qjQ+NcF2TYO/eI3M6v8EiNYZfA95pQumfvcVrTHtwQVDG+aHRqLi/ETn2uB+1JqwYqVG3LIvdm9lj6imS/pQ==" crossorigin="anonymous"></script>
  <title>About</title>
 </head>
<body>

【问题讨论】:

  • 检查网络控制台或最终可能阻止脚本加载的 Firefox 扩展

标签: html twitter-bootstrap firefox


【解决方案1】:

只是为了测试这一点,下载一个副本并在本地提供您的 CSS 文件。 Firefox 可能会阻止您的资产请求。在 Firefox 中检查控制台错误消息。

【讨论】:

    【解决方案2】:

    我建议您在为他人开发网站或应用程序时不要使用 CDN。当您自己做某事作为草稿时,CDN 非常适合引导布局。

    但是当涉及到为第三方分发时,我建议你下载引导包并在 HTML 页面所在的本地服务器上使用它。

    【讨论】:

    • 有趣的是,我经常看到人们支持这种观点,但有多少顶级网站不遵循它。比如这个。
    • 在我使用 css 和 js 文件的本地副本之前,Bootstrap 没有加载到 FireFox 中。现在似乎工作正常。感谢您的提示。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2018-06-14
    • 1970-01-01
    • 1970-01-01
    • 2012-11-23
    • 2016-02-10
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多