說我有以下HTML:正確的方式來包含使用HTML/CSS浮動元素?
<head>
<style>
#container {
border: 1px red solid;
}
.floaty {
width: 200px;
float: left;
border: 1px green solid;
}
</style>
</head>
<body>
<div id='container'>
Text inside the container
<div class='floaty'>
Floaty block 1<br/>
Floaty block 1<br/>
Floaty block 1<br/>
</div>
<div class='floaty'>
Floaty block 2<br/>
Floaty block 2<br/>
Floaty block 2<br/>
</div>
<div class='floaty'>
Floaty block 3<br/>
Floaty block 3<br/>
Floaty block 3<br/>
</div>
</div>
</body>
這使得爲:
什麼是正確的CSS的方式有容器(紅色邊框盒)完全包圍輕飄綠色接壤盒?
更新了它。謝謝! – 2014-02-17 14:31:48