これはおそらくチュートリアルや「HelloWorld」の場所ではありませんが、ここから始めましょう。
http://jsfiddle.net/rBNUy/
HTML:
<div class="main">
<div class="sidebar"></div>
<div class="top"></div>
<div class="bottom"></div>
</div>
CSS:
.main{ /* this makes the containing box 200x200 */
width: 200px;
height:200px;
background: #eee;
}
.sidebar{ /* this makes the sidebar 100x200 and makes it stick to as far left as it can */
background:blue;
float:left;
height:100%;
width: 100px;
}
.top, .bottom{ /* this makes the boxes 96x96 and makes them stick to as far left as they can , eventually till they hit the sidebar */
width: 96px;
height:96px;
float:left;
background:red;
border:solid 2px green;
}
コメントは明らかに過度に単純化されていますが、本質的に、「フローティング」は、単語に文字を積み重ねるのとほとんど同じように、要素を互いに積み重ねます。
フロートされた要素が同じ行にスタックされるスペースを使い果たした場合、次の行にホップし、スタックするのに最も近い「壁」を見つけます。