Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/34.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
CSS没有';不能在Chrome和IE中使用HTTPS页面_Css_Internet Explorer_Google Chrome_Https - Fatal编程技术网

CSS没有';不能在Chrome和IE中使用HTTPS页面

CSS没有';不能在Chrome和IE中使用HTTPS页面,css,internet-explorer,google-chrome,https,Css,Internet Explorer,Google Chrome,Https,在我的网站上,如果页面是用https打开的,Chrome无法加载样式表 例如,在test.php页面上,我有以下CSS包括: <link href="http://www.domain.com/css/mainstyle.css" rel="stylesheet" type="text/css"> 它使用绝对路径,因为有很多SEO、子目录等,所以像这样包含它要比寻找相对路径容易得多 如果我按正常方式打开页面,但如果我按Chrome拒绝加载样式表的方式打开页面 它适用于Firef

在我的网站上,如果页面是用https打开的,Chrome无法加载样式表

例如,在test.php页面上,我有以下CSS包括:

<link href="http://www.domain.com/css/mainstyle.css" rel="stylesheet" type="text/css">

它使用绝对路径,因为有很多SEO、子目录等,所以像这样包含它要比寻找相对路径容易得多

如果我按正常方式打开页面,但如果我按Chrome拒绝加载样式表的方式打开页面

它适用于Firefox和Safari。我可以理解IE是一个“特殊需要”的浏览器,但为什么Chrome会这样做,我如何修复它


使用调用CSS文件修复了该问题,但确实有必要吗?

也许可以尝试
协议相关URL


希望能有帮助

您需要在https页面的.htaccess文件中允许.css、.js、.png、.jpg、.bmp、.gif、.eof、.ttf、.svg文件

为了安全起见,Chrome不允许在这些页面上显示这些文件。
但是Firefox是允许的。

问题只出现在样式表上吗?因为页面未设置样式或您无法访问它?您是否尝试过
href=“///www.domain.com/css/mainstyle.css”
?如中所示,页面未设置样式。问题仅在样式表上,图像加载良好,Javascript也是如此。@PedroEstrada是的,解决了问题,谢谢。