0

おそらく簡単な質問ですが、div を使用して上下のアイテムがどのようにフローティングまたは配置されているかに関係なく、論理的にページを垂直に分割する最良の方法は何ですか? 印刷の都合上改ページではなく、Webでの閲覧用です。

私はこのようなことを試みていますが、うまくいきません:

<div id="top block" style="width: margin-left: auto; margin-right: auto; clear: both">
<div id="left" style="float: left; width: 200px">
<p>Text text text</p>
</div>
<div id="center" style="float: left; width: 500px;">
Image
</div>
<div id="right" style="float: left; width: 200px">
<p>Text text text</p>
</div>
</div> <!--End of top block-->

<div id="page break" style="width: 1000px; clear: both;"></div> <!--I want this to be a hard break where everything after it appears below-->

<div id="bottom block" style="text-align: center">
<p>Text text text</p>  <!--Things from this paragraph are popping up above the forced page break depending on how I align things.-->
</div>
4

1 に答える 1

0

私はあなたの問題に遭遇しません。ちなみに、「ブレーク」divに幅を指定する必要はありません。次を試すことができます。

<div id="page break" style="clear: both; display:block;"></div>

これは、彼の行動をよりよく見えるように div に色を付けたフィドルです。

于 2013-04-12T23:08:28.527 に答える