main.css文件未加载

时间:2019-01-15 12:50:21

标签: 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证书吗?

1 个答案:

答案 0 :(得分:1)

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

MDN Link

您最好的选择就是简单地使用https CDN,尤其是对于引导程序 贾斯汀(Juste)用枪打了个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>
相关问题