我有以下html/css導致Firefox 1.5和2的問題,但在IE6/7/8,Safari,Chrome,Opera和Firefox 1和3中正常工作。Firefox 1.5和2 css絕對位置錯誤
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Firefox Bug</title>
<style type="text/css">
* { border: 0; padding: 0; margin: 0; }
#wrapper {
width: 500px;
min-height: 550px;
height: auto !important;
height: 550px;
border: 5px solid blue;
position: relative;
display: inline;
overflow: auto;
float: left;
}
#content {
border: 5px solid green;
}
#bottom {
border: 5px solid red;
position: absolute;
bottom: 0;
right: 0;
width: 200px;
height: 100px;
}
</style>
</head>
<body>
<div id="wrapper">
<div id="content">
Foo
</div>
<div id="bottom">
Bar
</div>
</div>
</body>
</html>
在正常工作的瀏覽器中,底部元素顯示在包裝元素的右下角。但是,在Firefox 2中,底部元素位於內容元素的底部。我無法弄清楚爲什麼發生這種情況,任何幫助將不勝感激。
預期結果
Firefox 2的錯誤
問題在Firefox的更高版本中仍然存在。我在Ubuntu 14.04上使用v41,唯一可以讓DIV移動到底部的方法是取出容器並粘貼一個浮點。幸運的是,無論如何,這是一個正確的專欄,所以我只是添加了「float:right」,奇蹟般地解決了問題。確實很奇怪。即使在使用normalize.css之後,與其他瀏覽器相比,在FF上感到羞恥。 – Volomike 2016-04-21 06:22:59