ブートストラップのカードを縦並びと横並びを混ぜて表示したい。
ブートストラップのカードを3つのクラスに分けて、それぞれのクラスに3つ縦にカードを並べてから横にクラスを並べるように表示して行きたいのですが、全て縦並びになるので、改善したいです。
該当のソースコード
html
1div class="a"> 2 3<div class="l"> 4 5<div class="card1" style="width: 18rem;"> 6 <svg class="bd-placeholder-img card-img-top" width="100%" height="180" xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="xMidYMid slice" focusable="false" role="img" aria-label="Placeholder: Image cap"><title>Placeholder</title><rect fill="#868e96" width="100%" height="100%"/><text fill="#dee2e6" dy=".3em" x="50%" y="50%">Image cap</text></svg> 7 <div class="card-body"> 8 <p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p> 9 </div> 10</div> 11 12<div class="card1" style="width: 18rem;"> 13 <svg class="bd-placeholder-img card-img-top" width="100%" height="180" xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="xMidYMid slice" focusable="false" role="img" aria-label="Placeholder: Image cap"><title>Placeholder</title><rect fill="#868e96" width="100%" height="100%"/><text fill="#dee2e6" dy=".3em" x="50%" y="50%">Image cap</text></svg> 14 <div class="card-body"> 15 <p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p> 16 </div> 17</div> 18 19<div class="card1" style="width: 18rem;"> 20 <svg class="bd-placeholder-img card-img-top" width="100%" height="180" xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="xMidYMid slice" focusable="false" role="img" aria-label="Placeholder: Image cap"><title>Placeholder</title><rect fill="#868e96" width="100%" height="100%"/><text fill="#dee2e6" dy=".3em" x="50%" y="50%">Image cap</text></svg> 21 <div class="card-body"> 22 <p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p> 23 </div> 24</div> 25 26</div> 27 28<div class="c"> 29 30<div class="card1" style="width: 18rem;"> 31 <svg class="bd-placeholder-img card-img-top" width="100%" height="180" xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="xMidYMid slice" focusable="false" role="img" aria-label="Placeholder: Image cap"><title>Placeholder</title><rect fill="#868e96" width="100%" height="100%"/><text fill="#dee2e6" dy=".3em" x="50%" y="50%">Image cap</text></svg> 32 <div class="card-body"> 33 <p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p> 34 </div> 35</div> 36 37<div class="card1" style="width: 18rem;"> 38 <svg class="bd-placeholder-img card-img-top" width="100%" height="180" xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="xMidYMid slice" focusable="false" role="img" aria-label="Placeholder: Image cap"><title>Placeholder</title><rect fill="#868e96" width="100%" height="100%"/><text fill="#dee2e6" dy=".3em" x="50%" y="50%">Image cap</text></svg> 39 <div class="card-body"> 40 <p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p> 41 </div> 42</div> 43 44<div class="card1" style="width: 18rem;"> 45 <svg class="bd-placeholder-img card-img-top" width="100%" height="180" xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="xMidYMid slice" focusable="false" role="img" aria-label="Placeholder: Image cap"><title>Placeholder</title><rect fill="#868e96" width="100%" height="100%"/><text fill="#dee2e6" dy=".3em" x="50%" y="50%">Image cap</text></svg> 46 <div class="card-body"> 47 <p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p> 48 </div> 49</div> 50 51</div> 52 53<div class="c"> 54 55<div class="card1" style="width: 18rem;"> 56 <svg class="bd-placeholder-img card-img-top" width="100%" height="180" xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="xMidYMid slice" focusable="false" role="img" aria-label="Placeholder: Image cap"><title>Placeholder</title><rect fill="#868e96" width="100%" height="100%"/><text fill="#dee2e6" dy=".3em" x="50%" y="50%">Image cap</text></svg> 57 <div class="card-body"> 58 <p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p> 59 </div> 60</div> 61 62<div class="card1" style="width: 18rem;"> 63 <svg class="bd-placeholder-img card-img-top" width="100%" height="180" xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="xMidYMid slice" focusable="false" role="img" aria-label="Placeholder: Image cap"><title>Placeholder</title><rect fill="#868e96" width="100%" height="100%"/><text fill="#dee2e6" dy=".3em" x="50%" y="50%">Image cap</text></svg> 64 <div class="card-body"> 65 <p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p> 66 </div> 67</div> 68 69<div class="card1" style="width: 18rem;"> 70 <svg class="bd-placeholder-img card-img-top" width="100%" height="180" xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="xMidYMid slice" focusable="false" role="img" aria-label="Placeholder: Image cap"><title>Placeholder</title><rect fill="#868e96" width="100%" height="100%"/><text fill="#dee2e6" dy=".3em" x="50%" y="50%">Image cap</text></svg> 71 <div class="card-body"> 72 <p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p> 73 </div> 74</div> 75 76</div> 77 78 79</div>
css
1.card1 { 2 margin-left: 10px; 3 margin-bottom: 20px; 4}
試したこと
どのプロパティでもなかなかうまく行きませんでいた。
補足情報(FW/ツールのバージョンなど)
簡単なことかもしれませんが、ご協力お願いいたします。
回答1件
あなたの回答
tips
プレビュー