我無法弄清楚爲什麼在下面的代碼中(一個大的頁面,所有不必要的部分都被刪除了),Textarea在IE 6或7中偏離了右邊。它應該緊靠文本,就像它在Firefox中一樣。有任何想法嗎?IE CSS位置錯誤,有什麼想法爲什麼?
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>CSS Test</title>
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7">
<style type="text/css">
div.storeProductFormInner {
text-align: center;
}
div.storeProductFormInner div.storeProductChoices {
display: block;
width: 660px;
margin: 0px auto;
}
div.storeProductFormInner div.storeProductChoices fieldset {
position: relative;
display: block;
width: 660px;
margin: 10px auto 0px auto;
padding: 0px;
text-align: right;
font-weight: normal;
border: none;
}
div.storeProductFormInner div.storeProductChoices fieldset legend span {
display: block;
position: absolute;
top: 0px;
left: 0px;
width: 325px;
text-align: right;
font-weight: normal;
}
div.storeProductFormInner div.storeProductChoices fieldset div {
position: relative;
top: 0px;
left: 0px;
display: block;
width: 325px;
text-align: left;
border: none;
padding: 0px 0px 0px 10px;
margin: 0px 0px 0px 325px;
}
div.storeProductFormInner div.storeProductChoices fieldset div input,
div.storeProductFormInner div.storeProductChoices fieldset div select,
div.storeProductFormInner div.storeProductChoices fieldset div textarea {
margin: 0px;
position: relative;
top: 0px;
left: 0px;
}
div.storeProductFormInner div.storeProductChoices fieldset div textarea.TextboxXL {
width: 300px;
height: 200px;
}
</style>
</head>
<body>
<div id="container">
<div id="body_div">
<div id="content_div">
<div class="Module_Ecommerce_DF_product">
<div class="storeProductFormOuter">
<form id="ECommerce_DF_addToCart" action="/ajax_required.php" method="post">
<div class="storeProductFormInner">
<div class="storeProductChoices">
<fieldset>
<legend><span>Personalized:</span></legend>
<div>
<textarea name="choicetext_30378" rows="5" cols="20" id="eCommerce_DF_choice_30378" class="TextboxLG" title=""></textarea>
</div>
</fieldset>
</div>
</div>
</div>
</form>
</div>
</div>
</div>
<div class="clear"></div>
</div>
</div>
</body>
</html>
請在你的問題中包含你的代碼 - 這種方式在6個月內,當你早已把這個頁面放下時,有人仍然可以從你的問題中學習。 – BryanH 2009-07-20 20:34:30
好主意,我會編輯momentarilly – Josh 2009-07-20 20:56:25