0

How would I align divs like the following (example content below the divs)...I set float to left for both div1 and div2 but then div3 floated to the top right, how do I prevent this?

<div1>                <div2>
What is the temp.?    ____________________
Is it raining?        ____________________

<!-- Contains main content -->
<div3>
4

1 に答える 1

2

フローティング div の後に配置する明確な修正を設定する必要があります。これが私がすることです。

スタイルシートでこのクラスを作成します。

.clear {clear:both}

2 つのフローティング div の後、直前<div3>に次の htmlを含めます。

<div class="clear"></div>

これにより、3 番目の div がフローティング div の下に保持されます。

于 2013-10-31T18:10:36.270 に答える