CSS样式Firefox/Safari/Chrome

pat*_*ick 5 html css firefox webkit

我有浏览器之间的CSS差异问题.我有一个简单的输入文本字段和一个提交按钮.应该安排.使用webkit(safari/webkit)一切看起来都很好,但是firefox并没有这样做.有没有人知道什么是错的?

我写了一个小测试html页面:

<html>
<head>
<style type="text/css">

#input {
    background: none repeat scroll 0 0 white;
    border-color: #DCDCDC;
    border-style: solid;
    border-width: 1px 0 1px 1px;
    font: 13px "Lucida Grande",Arial,Sans-serif;
    margin: 0;
    padding: 5px 5px 5px 15px;
    width: 220px;
    outline-width: 0;
 height: 30px;
}

#submit {
    background: none repeat scroll 0 0 white;
    border: 1px solid #DCDCDC;
    font: 13px "Lucida Grande",Arial,Sans-serif;
    margin: 0;
    outline-width: 0;
 height: 30px;
    padding: 5px 10px;
}

</style>
</head>
<body>
<input id="input" type="text" value="" /><input id="submit" type="button" value="Add" />
</body>
</html>
Run Code Online (Sandbox Code Playgroud)

Mar*_*pel 1

您没有使用 Doctype,因此浏览器会退回到怪异模式

\n\n
\n

在 Quirks 模式下,浏览器违反当代 Web 格式规范,以避免破坏根据 20 世纪 90 年代末流行的做法编写的\xe2\x80\x9c 页面。不同的浏览器有不同的特性。在 Internet Explorer 6、7 和 8 中,Quirks 模式实际上会冻结 IE 5.5。在其他浏览器中,Quirks 模式与“Almost Standards”模式有一些偏差。

\n
\n