外部CSS正在使用localhost但不在在线服务器上工作 [英] External CSS is working on localhost but not working on online server

查看:69
本文介绍了外部CSS正在使用localhost但不在在线服务器上工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个网站。我链接到它的外部样式表在我的系统localhost上完美运行。但是当我将它上传到在线服务器时,它不起作用。因此我必须添加内部样式表,这会浪费内存和执行时间。我不知道问题是什么,代码完全没问题。我不知道如何解决这个问题。

这里是我网站的css链接: -

I created a website. And the external stylesheet which I have linked to it is working perfectly on my system localhost. But when I upload it to the online server, it doesn''t working. Because of this I have to add internal stylesheet which is waste of memory and execution time. I don''t know what is the problem, the code is perfectly allright. I don''t know how to fix this problem.
Here''s the css link to my website:-

展开 | 选择 | Wrap | 行号

推荐答案

问题可能是混合HTTP和HTTPS。

确保如果您的页面是HTTP,样式表也是HTTP 。


安全网站不允许混合协议。一切都必须从安全的服务器嵌入。浏览器将忽略/阻止HTTPS页面上的HTTP资源(具有不同程度的严格性)。
The problem is probably mixing HTTP and HTTPS.
Make sure that if your page is HTTP, the stylesheet is also HTTP.

Secure websites are not allowed to mix protocols. Everything has to be embedded from a secure server. Browsers will ignore/block HTTP resources on HTTPS pages (with varying degree of strictness).


感谢您的回复。你能解释一下如何做到这一点....
Thank you fro your kind response. Can you please explain how to do this....


首先我们要知道你如何访问你的网页,你使用HTTPS吗? HTTP。


我的猜测是你使用HTTTP。

如果这是真的,那么从''https://更改第5行...... ''到''http:// ...''


通常您不应该这样做(只需将HTTP更改为HTTPS或其他方式),但此页面也是可通过HTTP访问,您可以通过在浏览器的地址栏中键入此地址来检查。然后浏览器会响应下载,而不会给出错误404,这意味着页面存在。
First we have to know how you are going to your webpage, do you use HTTPS? of HTTP.

My guess is you use HTTTP.
If that is true, than change line #5 from ''https://...'' to ''http://...''

Normally you should not do that (just change HTTP to HTTPS or the other way around), but this page is also reachable via HTTP, which you can check by typing this address in the address bar of a browser. then browser will respond with a download, and not give an error 404, which means the page exists.


这篇关于外部CSS正在使用localhost但不在在线服务器上工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆