gpt4 book ai didi

显示为 "text/x-csrc"的 CSS 文件,在浏览器中被读取为 text/html 并被忽略

转载 作者:太空宇宙 更新时间:2023-11-03 19:34:27 24 4
gpt4 key购买 nike

Traq 安装包中包含的几个 css 文件在服务器上显示“text/x-csrc”的 MIME 类型。文件被浏览器读取为 text/html 并被忽略。

其他虚拟主机站点的 CSS 文件显示为 text/css。

enter image description here

我试过将“text/x-csrc”文件的内容复制并粘贴到文本编辑器中,然后在服务器上创建一个新文件并使用 vi 进行粘贴。同样的结果。

这是可疑文件,install.css :

/* http://meyerweb.com/eric/tools/css/reset/ 
v2.0 | 20110126
License: none (public domain)
*/

html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
font: inherit;
vertical-align: baseline;
}
/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure,
footer, header, hgroup, menu, nav, section {
display: block;
}
body {
line-height: 1;
}
ol, ul {
list-style: none;
}
blockquote, q {
quotes: none;
}
blockquote:before, blockquote:after,
q:before, q:after {
content: '';
content: none;
}
table {
border-collapse: collapse;
border-spacing: 0;
}

/*!
* Traq Install
* Copyright (c) 2009-2012 Traq.io
* @license GNU General Public License v3 only
*/
body {
font-family: Arial, Helvetica, sans-serif;
background: #e9e9e9;
color: #fff;
margin: 30px; }

#wrapper {
width: 580px;
margin: 0 auto;
border-radius: 5px;
box-shadow: 0 0 25px 1px rgba(0, 0, 0, 0.4); }

header {
background: #3478AA;
padding: 10px;
height: 20px;
border-radius: 5px 5px 0 0; }
header h1 {
font-weight: bold;
float: left; }
header h2 {
float: right;
font-weight: bold; }

#page {
background: #fff;
color: #000;
padding: 10px;
border-radius: 5px;
margin: -5px 0;
z-index: 10;
position: relative;
font-size: 14px; }

code {
font-family: "Courier New", Courier, monospace;
}

#licence, #config_code {
width: 550px;
height: 400px;
overflow: scroll;
margin: 0 auto;
background: #F6F6F6;
border: 1px solid #e4e4e4;
padding: 4px;
font-size: 12px;
font-family: "Courier New", Courier, monospace; }
#config_code {
height: 125px }

.tabular .group {
margin: 0;
padding: 5px 0;
padding-left: 250px;
clear: left; }
.tabular label {
font-weight: bold;
float: left;
margin-left: -250px;
text-align: right;
width: 245px;
font-size: 12px;
padding-top: 3px; }
.tabular input {
margin-top: 0px;
vertical-align: middle; }
.tabular select {
margin-top: 0; }

.actions {
text-align: center;
margin-top: 5px; }

.error label {
color: red; }
.error input {
border: 1px solid red;
padding: 2px; }

footer {
font-size: 11px;
padding: 6px;
padding-top: 10px;
background: #d9d9d9;
color: #000;
border-radius: 0 0 5px 5px; }

此文件中的什么可能会触发不正确的 MIME 类型?

编辑:

install.css 中的前两个字符是 /* - 注释的开始标记。显然我的 Apache 魔术文件将其解释为“C 源代码”而不是 CSS。

在默认 install.css 文件的开头添加一行 return 将 MIME 类型从 C Source 更改为 CSS。

该文件仍被 Chrome/Firefox 错误地识别为 text/html。我已将此添加到 httpd.conf:

AddType text/css .css

仍然没有骰子。 Firefox 和 Chrome 都错误地将其读取为 text/html。

帮忙吗?

最佳答案

您是从外部数据库还是其他什么地方读取的?我猜你错过了打开和关闭样式的标签。

关于显示为 "text/x-csrc"的 CSS 文件,在浏览器中被读取为 text/html 并被忽略,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12801717/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com