简体   繁体   English

CSS无法在IE或Firefox中运行 - Chrome工作正常

[英]CSS not working in IE or Firefox - Chrome works fine

The webpage at http://144.76.221.141:8000 is showing correct CSS styling in Chrome and Safari, but refuses to show in Firefox or Chrome. http://144.76.221.141:8000的网页显示了Chrome和Safari中正确的CSS样式,但拒绝在Firefox或Chrome中显示。 I have already seen that adding a doctype is a common fix for this, however this did not help at all with my problem. 我已经看到添加doctype是一个常见的修复方法,但这对我的问题没有任何帮助。 Any pointers to a solution would be greatly appreciated.. 任何指向解决方案的指针都将非常感激..

The type on your stylesheets need to be like the following: 样式表上的type必须如下所示:

<link type="text/css" href="/css/parent.css" rel="stylesheet">
<link type="text/css" href="/css/landing-page.css" rel="stylesheet">
<link type="text/css" href="/css/dropit.css" rel="stylesheet">

Removing the / at the begining. 删除/在开头。

Remove the slash in the type of your stylesheet declaration: 删除样式表声明类型中的斜杠:

<link rel="stylesheet" href="/css/parent.css" type="/text/css" />

to

<link rel="stylesheet" href="/css/parent.css" type="text/css" />

For this declaration that links your CSS 对于链接CSS的声明

<link href="/css/dropit.css" rel="stylesheet" type="/text/css"></link>

You need to remove the extra slash / on type="/text/css" should be 你需要删除额外的斜杠/ on type="/text/css"

<link href="/css/dropit.css" rel="stylesheet" type="text/css"></link>

You can write IE only CSS by adding this to your style sheet. 您只需将IE添加到样式表中即可编写IE。

<!--[if IE 8]>
<style>...</style>
<![endif]-->

For further reference you can visit http://www.quirksmode.org/css/condcom.html 如需进一步参考,请访问http://www.quirksmode.org/css/condcom.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM