我有以下的HTML如何獲得具有自動高度和浮動div的容器Div?
<style type="text/css">
<!--
.msg_ok{
font-family: "Trebuchet MS";
font-weight: bold;
font-size: 16px;
margin:0 auto;
padding:10px;
width:500px;
height:auto;
display:block;
}
.msg_ok{
background-color:#DCFFB9;
border:#003300 1px solid;
color:#003500;
}
-->
</style>
<div class="msg_ok" style="height:auto;">
<div style="display:block;float:left;width:350px; height:auto;">
<p>line 1<br>
line2<br>
line3<br>
line4<br>
line5<br>
</p>
</div>
<div style="display:block;float:left;width:100px; height:auto;">
<a href="#">Print</a>
</div>
</div>
我得到這樣的結果
但是我怎麼能得到像下面這樣的div容器與適合其大小自動高度結果與浮動divs裏面?
在此先感謝
參見[此頁](http://www.positioniseverything.net /easyclearing.html)以獲取有關包含浮點數的不同方法的詳細信息。 – CherryFlavourPez 2012-03-06 11:22:26