建站记录2-CSS文件未加载-已解决-Resource interpreted as Stylesheet but transferred with MIME type text/plain
来源:互联网 发布:java递归创建二叉树 编辑:程序博客网 时间:2024/05/29 05:56
网站链接 http://139.199.169.122/
在本地加载正常,上传到服务器之后,网页没有样式。
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.类似问题 :那么是否是服务器端设置错误?
参考网站: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文件
- 建站记录2-CSS文件未加载-已解决-Resource interpreted as Stylesheet but transferred with MIME type text/plain
- Resource interpreted as Stylesheet but transferred with MIME type text/plain
- 样式加载不出来,浏览器控制台报错:Resource interpreted as Stylesheet but transferred with MIME type text/html
- Resource interpreted as Stylesheet but transferred with MIME type text/html:以及Uncaught SyntaxError:
- Java过滤器引发的异常:Resource interpreted as Stylesheet but transferred with MIME type text/html
- Resource interpreted as Image but transferred with MIME type text/plain 警告解决方案
- Chrome 报 Resource interpreted as Script but transferred with MIME type text/plain 警告的解决办法
- 关于 Resource interpreted as Script 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
- Resource interpreted as Stylesheet but transferred with MIME type application/octet-stream
- web——css和图片突然加载不了,console报错:Resource interpreted as script but transferred with MIME type text/html.
- 关于chrome Resource interpreted as Script but transferred with MIME type text/html的问题
- 关于chrome Resource interpreted as Script but transferred with MIME type text/html的问题
- golange 错误如下 Resource interpreted as Script but transferred with MIME type text
- Resource interpreted as Script but transferred with MIME type text/html
- ajaxfileupload上传文件,返回json数据报错的问题。 Resource interpreted as Document but transferred with MIME type ap
- 关于easyui Resource interpreted as Document but transferred with MIME type application/json
- 猕猴桃,程序员们的明智选择!
- DOM基本操作
- CRM系统哪家好?CRM系统功能介绍
- Java 使用 ObjectStream 时的注意事项
- MapReduce原理
- 建站记录2-CSS文件未加载-已解决-Resource interpreted as Stylesheet but transferred with MIME type text/plain
- 【剑指Offer】连续子数组的最大和
- ubuntu1604下 快捷键 ctrl alt b 会出现软键盘
- 一些平时会用到的资料
- tensorflow学习笔记(3):会话(session)
- 智邦国际CRM系统核心功能作用
- 用jqueryweui框架开发的微信公众号,底部按钮弹出对话框苹果真机上无效果的问题
- 打不开IDLE
- windows服务器上安装Apache+php+Mariadb(mysql的分支数据库)详细教程