以下のhtmlの<div class="main top-main">と<div class="about-main">の要素が被って表示されます。
順番に表示させるにはどうしたらいいのでしょうか?
html
1<div class="main top-main"> 2 <div class="top-message"> 3 <h2>AAA</h2> 4 <p>AAA</p> 5 </div> 6</div> 7 8<div class="about-main"> 9 <h2>AAA</h2> 10 <p>AAA</p> 11 <img class="about-img" src="/aaa.png"> 12</div>
css
1.main { 2 position: absolute; 3 top: 64px; 4 width: 100%; 5 height: auto; 6 min-height: 100%; 7 background-color: #fff; 8} 9.top-main { 10 padding: 200px 0 100px; 11 text-align: center; 12 position: absolute; 13 top: 0; 14 width: 100%; 15 height: auto; 16 min-height: 100%; 17 color: black; 18 background-color: #fff; 19 background-repeat: no-repeat; 20 background-position: center 50%; 21 background-size: cover; 22 background-image: url("/summer-book.jpg"); 23} 24.top-message { 25 position: relative; 26} 27.about-main { 28 padding: 180px 8% 0; 29 color: black; 30} 31.about-img { 32 width: 84%; 33} 34 35
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2019/01/29 11:55