建站记录2-CSS文件未加载-已解决-Resource interpreted as Stylesheet but transferred with MIME type text/plain
2017-08-28 15:12
696 查看
网站链接 http://139.199.169.122/
问题锁定在服务器设置中。
找研究后端的马同学检查配置,发现是少了一行include命令。
在正确配置mime.types文件 .css文件为text/css类型之后,需要把此文件include到ngnix.conf中。
至此,圆满解决。
特别鸣谢马同门!!!!
这是他的个人网站-----一个图片分享网站
解决问题的过程:
--->操作--需要进一步确认不是路径问题:去掉文件夹,去掉引用,CSS文件与index.html放置在同一个文件夹内:仍然无法显示样式。
结论:不是路径引用问题。
结论:不是CSS内容编写错误。
6.FireFox F12检查
FireFOX提示
参考网站:MIME类型导致CSS在firefox下无效
确认服务器端与本地的.css文件都为text/css,仍未解决。
参考网站:网页文档类型不一致
参考网站:DOCTYPE引起CSS不能正确显示的一些思考
问题锁定在服务器设置中。
找研究后端的马同学检查配置,发现是少了一行include命令。
在正确配置mime.types文件 .css文件为text/css类型之后,需要把此文件include到ngnix.conf中。
至此,圆满解决。
特别鸣谢马同门!!!!
这是他的个人网站-----一个图片分享网站。
HTML文件
在本地加载正常,上传到服务器之后,网页没有样式。
10.最终正确方案
重装了服务器系统,在别人的服务器上传同样的文件,发现正确。问题锁定在服务器设置中。
找研究后端的马同学检查配置,发现是少了一行include命令。
在正确配置mime.types文件 .css文件为text/css类型之后,需要把此文件include到ngnix.conf中。
至此,圆满解决。
特别鸣谢马同门!!!!
这是他的个人网站-----一个图片分享网站
解决问题的过程:
1. 是否路径问题?
--->分析:应该不是路径问题。页面中引用了图片,路径格式与CSS文件相同,图片可以正确加载。--->操作--需要进一步确认不是路径问题:去掉文件夹,去掉引用,CSS文件与index.html放置在同一个文件夹内:仍然无法显示样式。
结论:不是路径引用问题。
2.是否CSS内容编写错误,导致浏览器无法识别?
--->将CSS内容复制到html-head-script中,加载运行:顺利显示。结论:不是CSS内容编写错误。
3.W3C检查网页。
--->没有错误,没有警告。4.知乎搜索——>用chrome的F12检查页面
5.搜索操作---->修改注册表。
--->仍然报错??6.FireFox F12检查
FireFOX提示7.类似问题 :[b]那么是否是服务器端设置错误?[/b]
参考网站:CSS是text/plain.不是text/css参考网站:MIME类型导致CSS在firefox下无效
确认服务器端与本地的.css文件都为text/css,仍未解决。
8.最终解决/错误方案
解决手段:删去了html头部的声明<!DOCTYPE html>参考网站:网页文档类型不一致
9.进一步思考
删去声明其实是不对的,那么问题到底是什么呢?参考网站:DOCTYPE引起CSS不能正确显示的一些思考
10.最终正确方案
重装了服务器系统,在别人的服务器上传同样的文件,发现正确。问题锁定在服务器设置中。
找研究后端的马同学检查配置,发现是少了一行include命令。
在正确配置mime.types文件 .css文件为text/css类型之后,需要把此文件include到ngnix.conf中。
至此,圆满解决。
特别鸣谢马同门!!!!
这是他的个人网站-----一个图片分享网站。
HTML文件
相关文章推荐
- Resource interpreted as Stylesheet but transferred with MIME type text/plain
- Resource interpreted as Stylesheet but transferred with MIME type text/plain
- web页面 显示 Resource interpreted as Stylesheet but transferred with MIME type text/plain的错误警告
- Chrome 报 Resource interpreted as Script but transferred with MIME type text/plain 警告的解决办法
- 警告:Resource interpreted as Stylesheet but transferred with MIME type application/x-css
- web——css和图片突然加载不了,console报错:Resource interpreted as script but transferred with MIME type text/html.
- Java过滤器引发的异常:Resource interpreted as Stylesheet but transferred with MIME type text/html
- Chrome 报 Resource interpreted as Script but transferred with MIME type text/plain 警告的解决办法
- Resource interpreted as Stylesheet but transferred with MIME type application/x-css
- Chrome 报 Resource interpreted as Script but transferred with MIME type text/plain 警告的解决办法
- Resource interpreted as Stylesheet but transferred with MIME type text/html:以及Uncaught SyntaxError:
- odoo 错误 Resource interpreted as Stylesheet but transferred with MIME type application/x-css:
- Resource interpreted as Stylesheet but transferred with MIME type application/x-css
- Resource interpreted as Script but transferred with MIME type text/plain
- Resource interpreted as Stylesheet but transferred with MIME type application/octet-stream
- Resource interpreted as Script but transferred with MIME type text/plain:
- 关于 Resource interpreted as Script but transferred with MIME type text/plain问题的处理
- Resource interpreted as Image but transferred with MIME type text/plain 警告解决方案
- CSS引入错误Resource interpreted as Stylesheet but transferred with MIME
- golange 错误如下 Resource interpreted as Script but transferred with MIME type text