最初のdiv(テキストを含む)でイメージをプッシュしないようにするにはどうすればよいですか? 2番目と同様に、テキストが長い場合は、画像が右側にプッシュされます。最初のdivが次の部分をプッシュしないようにする
私は、テキスト付きのdivは左に浮動小数点があり、左と右のパディングがあることを述べました。
また、画像を正しくフロートできません。
任意のアイデア?
これはコードです:
.text box {
float: left;
padding-right: 100px;
padding-left: 100px;
}
div#firstimagediv,
div#secondimagediv {
width: 657px;
height: 225px;
max-width: 100%;
max-height: 100%;
overflow: hidden;
margin-left: 50px;
}
div#firstimagediv figure {
background-image: url(https://placeholder.pics/svg/200.jpg);
background-size: cover;
position: relative;
font-size: 0;
width: 100%;
height: 100%;
margin: 0;
}
div#secondimagediv figure {
background-image: url(https://placeholder.pics/svg/200.jpg);
background-size: cover;
position: relative;
font-size: 0;
width: 100%;
height: 100%;
margin: 0;
}
<div class="text box">
<h1>Text</h1>
<p>ParagraphParagraphParagraphParagraph</p>
<p>Paragraph</p>
<p>Paragraph</p>
<p>Paragraph</p>
<p>Paragraph</p>
</div>
<div id="firstimagediv">
<figure>
<div id="firstimage"></div>
</figure>
</div>
<div class="text box">
<h1>Longer Text</h1>
<p>ParagraphParagraphParagraphParagraph</p>
<p>Paragraph</p>
<p>Paragraph</p>
<p>Paragraph</p>
<p>Paragraph</p>
</div>
<div id="secondimagediv">
<figure>
<div id="secondimage"></div>
</figure>
</div>
私たちは、あなたが間違って何をしたかのアイデアを取得するようにコードを投稿しますか? – Debabrata
@Debabrata ...それが追加されました、ありがとう – Adrian
基本的にdiv内のテキストを折り返したいのですか?長い行が続いて複数の行に分割したい場合は、 – Debabrata