私は自分のプロジェクトの証言パートに取り組んでいます。 4つのdivがありますが、内容が不揃いなので、画面の幅を合わせると、col-sm-6
には2-2のように並んでいるはずですが、div 3がdiv4、空のスペースを残して、その後div4は1行下にジャンプします。どのように私はそれらを台無しにすることを防ぐことができますか?ブートストラップ列が片方の部分から他の部分に飛び散るのを防ぐにはどうすればいいですか?
.testimonial-content {
text-align: center;
margin: 15px auto 15px auto;
}
.testimonial-content h5 {
margin-top: 20px;
}
.testim-logo-container {
height: 100px;
width: 100%;
display: flex;
justify-content: center;
align-items: center;
}
.testimonial-logo {
max-width: 100px;
}
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">
<div class="row">
<div class="testimonial-content">
<div class="col-lg-3 col-sm-6 col-xs-12">
<div class="testim-logo-container">
<img class="img-responsive testimonial-logo" src="http://placehold.it/200x50/999/000/?text=1" alt="testimonial logo">
</div>
<p>"It's amazing to see the progress of the students, that Laszlo and Balazs has been going through during the Multimedia Design education at the IBA."</p>
<h5>Tina Østergaard Filsø</h5>
<h5>Visual Communication - IBA</h5>
</div>
</div>
<div class="testimonial-content">
<div class="col-lg-3 col-sm-6 col-xs-12">
<div class="testim-logo-container">
<img class="img-responsive testimonial-logo" src="http://placehold.it/200x50/6c9/000/?text=2" alt="testimonial logo">
</div>
<p>"Laszlo showed dedication and self discipline during his period with Our Daily Heroes."</p>
<h5>Gyula Vajda</h5>
<h5>CEO - Our Daily Heroes</h5>
</div>
</div>
<div class="testimonial-content">
<div class="col-lg-3 col-sm-6 col-xs-12">
<div class="testim-logo-container">
<img class="img-responsive testimonial-logo" src="http://placehold.it/200x50/c96/000/?text=3" alt="testimonial logo">
</div>
<p>"It was great to work with Balazs, easy going, enthusiastic, works fast and on a reasonable price."</p>
<h5>Dániel Szilágyi</h5>
<h5>Founder - BudapestDenTrip</h5>
</div>
</div>
<div class="testimonial-content">
<div class="col-lg-3 col-sm-6 col-xs-12">
<div class="testim-logo-container">
<img class="img-responsive testimonial-logo" src="http://placehold.it/200x50/96c/000/?text=4" alt="testimonial logo">
</div>
<p>"Laszlo was a top-A intern, he took the assignments very seriously and executed them well.<br />He is enthusiastic to learn and experience new things."</p>
<h5>Björgvin Pétur</h5>
<h5>Senior Designer - //JÖKULÁ</h5>
</div>
</div><!-- Testimonials end-->
</div><!-- Testimonials row ends-->
、列に問題を解決するために、おそらく最も簡単な方法を、固定の高さを与えます。 –
何かの理由で私はそれらに固定された高さを与えると、それらは互いに下の単一の列にジャンプしますが、固定幅を追加しようとすると、4列すべての合計幅が元になります。 300px私は閉じたdivタグや同じ名前のラッパーを見つけることができませんでした... – sklrboy
その間、 'col-lg、sm、xs'属性クラスは' .testimonial-したがって、それに対して固定されたサイズのセットが、すべてのために合計で適用されます。これらの2つを変更した後、 '.testimonial-content'がcol-classの中にあるので、与えられた設定はそれぞれ別々にうまく動作します。 – sklrboy