スライダーの下に続くべき要素がかぶってしまいます。
こちらのスライダーを
使いたいのですが、
このスライドの下に続く要素がスライダーの下(裏)に隠れてしまい、表示できません。
どうしたらスライダーの下に続かせられますか?
下記コードは上記リンクを少しいじっています。
cssの@keyframes は割愛しています。
positionかなと思うのですが、
.slideshowにabsoluteがかかっていて混乱してきました。
.box1にmargin-topもおかしな気がします。
初歩で申し訳ありませんが、宜しくお願い致します。
html
1 <h1><small>Fullscreen</small> Ken Burns effect <small>without javascript</small></h1> 2 3 <div class="slideshow"> 4 <div class="slideshow-image" style="background-image: url('https://source.unsplash.com/category/nature/1600x1400')"></div> 5 <div class="slideshow-image" style="background-image: url('https://source.unsplash.com/category/buildings/1600x1400')"></div> 6 <div class="slideshow-image" style="background-image: url('https://source.unsplash.com/category/food/1600x1400')"></div> 7 <div class="slideshow-image" style="background-image: url('https://source.unsplash.com/category/technology/1600x1400')"></div> 8 </div> 9 10 <div class="box1"> 11 <p>テストテストテストテストテストテストテストテスト</p> 12 </div>
css
1.slideshow { 2 position: absolute; 3 width: 100vw; 4 height: 400px; 5 overflow: hidden; 6} 7.slideshow-image { 8 position: absolute; 9 width: 100%; 10 height: 100%; 11 background: no-repeat 50% 50%; 12 background-size: cover; 13 animation-name: kenburns; 14 animation-timing-function: linear; 15 animation-iteration-count: infinite; 16 animation-duration: 16s; 17 opacity: 1; 18 transform: scale(1.2); 19} 20h1 small { 21 display: block; 22 text-transform: lowercase; 23 font-size: .7em; 24} 25h1 small:first-child { 26 border-bottom: 1px solid rgba(0, 0, 0, 0.25); 27 padding-bottom: .5em; 28} 29h1 small:last-child { 30 border-top: 1px solid rgba(0, 0, 0, 0.25); 31 padding-top: .5em; 32} 33.box1 { 34 background: #08315C; 35 color: #fff; 36 height: 300px; 37 text-align: center; 38}
回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2019/03/01 02:41