我相信你之前已經聽說過... div在IE中沒有正確居中,即使它在Chrome和Firefox中完美工作。我已經研究過並嘗試過使用文本對齊和自動邊距的東西,但已經空了。我也嘗試用另一個div或其他東西替換標籤,但沒有任何積極的結果。任何人都可以提供的見解將不勝感激。Div並不以IE爲中心
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
.thumbnails {
background-color:white;
border: solid 1px #000099;
height:120px;
width: 640px;
overflow-y:scroll;
margin-bottom:20px;
position:relative;
padding-top: 10px;
}
#hugeimage {
background-color:white;
border-top: solid 1px #000099;
border-left: solid 1px #000099;
border-right: solid 1px #000099;
height:550px;
width: 640px;
display:table-cell;
vertical-align:middle;
}
#hugeimage a,
#hugeimage img {
margin: 0px;
padding: 0px;
border: 0px;
}
#imageinfo {
background-color:white;
border-left: solid 1px #000099;
border-right: solid 1px #000099;
width: 640px;
}
body {
background-color: #99ccff;
text-color: #000099;
}
</style>
</head>
<body>
<h3 align="center">Ship Detail</h3>
<center>
<div class="filedrop">
<div id="hugeimage">
<a href="#" target="_blank">
<img src="images/spin/wait30.gif" />
</a>
</div>
<div id="imageinfo"></div>
<div class="thumbnails"></div>
</div>
</center>
</body>
</html>
我已經從div中刪除數據。這個裸骨骼標記仍然有巨大的圖像和imageinfo div在IE中左對齊,但不是在chrome/ff中。
在你測試了這是什麼版本的IE? – Matt
我在這裏創建了相應的提琴:http://jsfiddle.net/arnley/4EerD/ –
它在IE 8和9中。通過在外部div上設置固定寬度,如果用戶調整窗口大小,是不是搞砸了嗎?我想我可以爲resize事件創建一個處理程序。我無法從家中訪問代碼,但我明天會檢查它。 – Derek