0

私はそのようなコードを持っています:

<div style="position:relative">
    <div style="float:left; width: 183px; background-color:#c1cba9; color: #000000;"><img border="0" alt="Product categories" title="Product categories" src="graphic/categrieshead.png" width="179" height="43"><br />
        <div style="margin-left: 10;">Links goes here</div><br />
        <img border="0" src="graphic/catbot.png" width="179" height="17"></div>
    <div style="float:left; width: 480px; height:100px; text-align: center;"><img border="0" src="graphic/description.png" width="232" height="81"><br /><div style="text-align: left; margin-left: 10;">asasasas</div></div>
    <div style="float:left; width: 322px; height:100px; text-align: center;">
        <div style="width: 300px; color: #ffffff; background-color:#6b8861; font-size : 34px;">Item title</div>
        <div style="width: 300px; color: #ffffff; background-color:#6b8861;"><div style="width: 296px; margin: 2 2 2 2; background-color:#ffffff;">Item picture</div><div style="width: 300px; height: 2px; background-color:#6b8861; color: #6b8861;"></div></div>
        <div style="width: 300px; color: #801010; font-size : 60px;">Price: 20£</div>
    </div>
</div>

これらの3つのdivの下にコンテンツ(テキスト)が表示されるdivを追加する必要がありますが、テキストを追加するだけで、テキストが適切な場所に表示されません(右側の境界外)、前述の部分の後にdivを追加するにはどうすればよいですか?プレビューのその部分の下に?

4

2 に答える 2

1

質問を正しく理解している場合は、新しい div の CSS を追加する必要がありますclear:both

于 2013-01-09T13:30:15.713 に答える
1

clear:both;フローティング要素の後に要素を使用します。

<div style="clear: both;"></div>

この後、新しいコンテンツ div を挿入すると、他の div の下に配置されます。

于 2013-01-09T13:28:57.770 に答える