<やりたいこと>
- @media (min-width: ;)を用いて320-992pxの時、
1. middle-sectionを縦6つ
2. bottom-sectionを縦4つ
にレイアウトしたい。
<分からないこと>
メディアクエリでFlexboxを用いたレイアウト
<用件>
- ブレークポイントは以下の5つを設定。(最小設定は320px)
xs: 480px未満
sm: 480px以上768px未満
md: 768px以上992px未満
lg: 992px以上1100px未満
xl: 1100px以上
Middle section
HTML
1 <!-- middle section start --> 2 <section class="middle-section-wrapper"> 3 <div class="full-width-container"> 4 <div class="row middle-columns"> 5 <div class="bg-shose column-4"> 6 </div> 7 <div class="column-4"> 8 <div class="middle-column-content"> 9 <h3>MIDDLE COLUMUN</h3> 10 <h2> 11 Lorem ipsum dolor sit amet, consectetur adipisicing elit, 12 </h2> 13 <p> 14 Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore 15 magna 16 aliqua. 17 </p> 18 </div> 19 </div> 20 <div class="bg-sunglasses column-4"> 21 </div> 22 </div> 23 </div> 24 <div class="full-width-container"> 25 <div class="row middle-columns"> 26 <div class="column-4"> 27 <div class="middle-column-content"> 28 <h3>MIDDLE COLUMUN</h3> 29 <h2> 30 Lorem ipsum dolor sit amet, consectetur adipisicing elit, 31 </h2> 32 <p> 33 Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore 34 magna 35 aliqua. 36 </p> 37 </div> 38 </div> 39 <div class="bg-guy-with-cap column-4"> 40 </div> 41 <div class="column-4"> 42 <div class="middle-column-content"> 43 <h3>MIDDLE COLUMUN</h3> 44 <h2> 45 Lorem ipsum dolor sit amet, consectetur adipisicing elit, 46 </h2> 47 <p> 48 Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore 49 magna 50 aliqua. 51 </p> 52 </div> 53 </div> 54 </div> 55 </div> 56 </section> 57 <!-- middle section end -->
Bottom seciton
HTML
1<!-- bottom section start --> 2 <section class="bottom-section-wrapper"> 3 <div class="container"> 4 <div class="row"> 5 <div class="column-12"> 6 <h2 class="bottom-section-title">BOTTOM SECTION</h2> 7 </div> 8 </div> 9 <div class="row"> 10 <div class="column-6"> 11 <img src="./images/nick-karvounis-261181.jpg" alt="bottom-section-img" /> 12 </div> 13 <div class="column-6"> 14 <div class="bottom-section-content-wrapper"> 15 <h2>SECTION TITLE</h2> 16 <p> 17 Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna 18 aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. 19 Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint 20 occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. 21 </p> 22 </div> 23 </div> 24 </div> 25 <div class="row"> 26 <div class="column-6"> 27 <div class="bottom-section-content-wrapper"> 28 <h2>SECTION TITLE</h2> 29 <p> 30 Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna 31 aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. 32 Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint 33 occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. 34 </p> 35 </div> 36 </div> 37 <div class="column-6"> 38 <img src="./images/kristian-egelund-476932.jpg" alt="bottom-section-img" /> 39 </div> 40 </div> 41 </div> 42 </section> 43 <!-- bottom section end -->
メディアクエリ部分
CSS
1@media (min-width: 320px) { 2 .top-main h1 { 3 font-size: 40px; 4 } 5 6 .top-main h2 { 7 font-size: 30px; 8 } 9 10 .top-main p { 11 text-align: center; 12 font-size: 15px; 13 padding: 15px; 14 margin: 0 auto; 15 } 16 17 ** .column-4 { /* middle-sectionを6個のコンテンツを縦6列に並べたいができない */ 18 display: flex; 19 flex-direction: column; 20 }** 21 22} 23 24@media (min-width: 480px) { 25 .top-main h1 { 26 font-size: ; 27 } 28} 29 30@media (min-width: 768px) { 31 .top-main h1 { 32 font-size: ; 33 } 34} 35 36@media (min-width: 992px) { 37 .top-main h1 { 38 font-size: ; 39 } 40} 41 42@media (min-width: 1100px) { 43 .top-main h1 { 44 font-size: ; 45 } 46}
*質問内容が不明な場合や質問の仕方に問題がある場合はご指摘ください。
回答1件
あなたの回答
tips
プレビュー