I'm trying to set a width for a child element which parent's position is relative. But when I give a width to child larger than parent's width, the parent's width in FireFox will be changed. And which in IE6/IE7, I must change the parent's width then the child's can be changed. Now, I need to change the child's width but not change it's parent's.Thx!
#container {
width:300px;
height:300px;
position: relative;
background:#666;
}
#box {
height:100px;
position: absolute;
top: 100px;
left: 50px;
background:#006;
max-width:300px;
min-width:220px;
}
<div id="container" style="float:left;">
<div id="box">
<div>
<table style="border:none;padding:0 0 0 0; margin:0 0 0 0em;" border="0" cellpadding="0" cellspacing="0">
<tr>
<td style="width:300px; word-wrap:break-word; word-break:break-all;">
bmkmgklkldfbmm bmsdfkmsdfl vmsdfklvmkbsbndfbf msdvmkdvsdfkmvcnas dcbnasdjkcn asdjudhcud cadjkcnasdcbnasd jkcnasdj
</td>
</tr>
</table>
</div>
</div>
</div>
<div style="float:left;">
udhcudcadjkcnasdcbnasdjkcnasdj
</div>