简介
我有两个域,http://mauricevandorst.com/和 http://tacticalmotion.nl/ .
我想要什么
我要网站https://mauricevandorst.com/personal-page/index.html与 http://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 内容。
最好的办法就是简单地使用 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/