我无法弄清楚为什么在下面的代码中(一个大的页面,所有不必要的部分都被删除了),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