コンテナ内に3つのdivがラップされています。各部門内には、その下にイメージとテキストがあります。私はすべての3つの部門を横並びにして対応したいと思っています。私はこれを望んでいた場所の前に設定しましたが、画面が縮小して中間のものが落ちると、右のdivが他の2つの下に落ちます。私は前にそれをしていたので、私は3つを横に並べることができることを知っています。私はどうしたのか分かりません。3つのdivsをインラインに維持
HTML
<div id='container'>
<div class='one-third'>
<a><img src='http://gratisography.com/pictures/264_1.jpg'><h3>Headline</h3></a><p>Medieval texts date the arrival of the Vikings in the British Isles to the 790s A.D., when fierce raiders from Scandinavia suddenly appeared along the coasts, plundering rich monasteries and terrorizing local communities. </p>
</div>
<div class='one-third'>
<a><img src='http://gratisography.com/pictures/264_1.jpg'><h3>Headline</h3><p>Medieval texts date the arrival of the Vikings in the British Isles to the 790s A.D., when fierce raiders from Scandinavia suddenly appeared along the coasts, plundering rich monasteries and terrorizing local communities. </p>
</div>
<div class='one-third'>
<a><img src='http://gratisography.com/pictures/264_1.jpg'><h3>Headline</h3><p>Medieval texts date the arrival of the Vikings in the British Isles to the 790s A.D., when fierce raiders from Scandinavia suddenly appeared along the coasts, plundering rich monasteries and terrorizing local communities. </p>
</div>
<div>
CSS
.one-third {
width: 30%;
display: inline-block;
margin: 5% 0 0 2.5%; }
.one-third img {
width: 100%;
height: 300px; }
.one-third h3 {
margin: .5em 0 2em 0; }
Simon、あなたのJSFiddleは私がそれをしたい方法で動作します。しかし、私がサブライムを通してそれを実行すると、divはゆっくりと滑り落ちます。私はこれの下に底のセクションを持っていて、それの上にもセクションがあります。これと関係があるかどうかはわかりません。浮動小数点のために私はクリアしなければなりませんでした。どちらもボトムセクションのために、ページを這わせません。あなたのコードがなぜ機能し、私のコード(あなたのものとまったく同じ)のアイデアはありませんか? – jwdwsn
テンプレートの余白のために、他のコードやウェブサイトを見ずにはるかに多くのことを言うことはできません。 –
サイモン、私は明らかにしました。コンテナにも問題が解決したようです。助けてくれてありがとう。 – jwdwsn