javascript - main.css 文件未加载

标签 javascript html css

简介

我有两个域,http://mauricevandorst.com/http://tacticalmotion.nl/ .


我想要什么

我要网站https://mauricevandorst.com/personal-page/index.htmlhttp://tacticalmotion.nl/personal-page/index.html 相同的网站.文件和路径完全相同,所以它应该可以工作,但不幸的是它没有..


问题

在我的域中,mauricevandorst , .css 文件完美加载。 在我的其他域中,tacticalmotion , .css 文件根本不会加载。

要在我的 Index.html 中加载 .css 文件,我使用以下代码:

<!-- Custom Theme CSS -->
<link href="css/main.css" rel="stylesheet">

我使用的 CSS 文件可以在这里找到:

main.css - bootstrap.css - bootstrap.min.css


额外信息

我发现加载时 http://www.mauricevandorst.com/personal-page/index.html (http 而不是 https)也给出了错误。有没有可能是 SSL 证书遗漏了?

最佳答案

问题是,由于您的网站使用 HTTPS,因此您无法加载 HTTP 内容。

MDN Link

最好的办法就是简单地使用 https CDN,尤其是用于 Bootstrap 只需尝试使用这些 url。

<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">

<!-- Optional theme -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous">

<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>

关于javascript - main.css 文件未加载,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54199238/

相关文章:

html - 创建具有宽边框的表格行,而不会渗透到相邻行

javascript - 获取多个 div 之间的距离(水平距离,即左边界到右边界 - 以像素为单位)

javascript - 如果另一列匹配 JavaScript 中的条件,则来自数组数组的列

html - spy Web 应用程序 - 路径属性中的通配符不起作用

html - 指定 div 宽度时,它是相对于窗口或父对象的大小?

html - 当相对定位的 div 位于页面末尾时,底部边距为零

javascript - 在 webpack 配置文件中使用 babel 插件

javascript - 通过其形式 ax 旋转点使其自身移动到左上角

php - 如何隐藏选择>选项下拉列表中的任何元素?

css - div并排问题