cssでズームしながら表示が切り替わるスライドショーを設置しています。
この上に、ロゴ画像(.svg)・文字を常に表示しておきたいのですが…
一緒にスライドしてしまいます。
スライド画像の前面に固定で表示したいです。
追記
HTMLの
HTML
1<div class="hero"> 2 <div class="main_imgBox"> 3 <div class="main_img" style="background-image: url(<?php echo get_template_directory_uri(); ?>/#.jpg)"></div> 4 <div class="main_img" style="background-image: url(<?php echo get_template_directory_uri(); ?>#.jpg)"></div> 5 </div> 6<div class="hero-mas"> 7 <h1> 8 <img src="<?php echo get_template_directory_uri(); ?>/#.svg" alt="ロゴマーク"> 9 </h1> 10 <h2>コピー</h2> 11 <p>コピーコピーコピーコピーコピーコピーコピー</p> 12</div> 13 <p class="copyRight">Copyright © ##### All right reserved.</p> 14 <div class="arrowWrap"> 15 <div class="arrowInner"> 16 <p>Scroll</p> 17 <div class="arrow"></div> 18 </div> 19 </div> 20</div>
CSS
1.main_imgBox { 2 height: 700px; 3 overflow: hidden; 4 position: relative; 5} 6.main_img { 7 z-index:10; 8 opacity: 0; 9 width: 100%; 10 height: 700px; 11 background-position: center center; 12 background-repeat: no-repeat; 13 background-size: cover; 14 position: absolute; 15 left: 0; 16 top: 0; 17 -webkit-animation: anime 14s 0s infinite; 18 animation: anime 14s 0s infinite; 19} 20 .main_img:nth-of-type(2) { 21 -webkit-animation-delay: 7s; 22 animation-delay: 7s; 23} 24@keyframes anime { 25 0% { 26 opacity: 0; 27 } 28 21% { 29 opacity: 1; 30 } 31 42% { 32 opacity: 1; 33 } 34 80% { 35 opacity: 0; 36 transform: scale(1.2) ; 37 z-index:9; 38 } 39 100% { opacity: 0 } 40} 41.hero-mas{ 42position: absolute; 43top: 50%; 44left: 50%; 45 transform: translateY(-50%) translateX(-50%); 46 -webkit-transform: translateY(-50%) translateX(-50%); 47 margin: auto; 48min-width:300px; 49} 50.hero-mas h1{ 51 width: 200px; 52 margin: 0 auto; 53 height: auto; 54 text-align: center; 55 filter: drop-shadow(4px 4px 3px rgba(0,0,0,0.5)); 56} 57.hero-mas h2{ 58 color: white; 59 text-align: center; 60 margin: 20px 0 5px 0; 61 font-size: 36px; 62 font-weight: bold; 63 letter-spacing: 0.3em; 64 filter: drop-shadow(4px 4px 3px rgba(0,0,0,0.5)); 65} 66.hero-mas p{ 67 color: white; 68 text-align: center; 69 font-size: 16px; 70 font-weight: bold; 71 filter: drop-shadow(0px 0px 3px rgba(0,0,0,0.5)); 72 line-height: 2; 73} 74 75.copyRight { 76 position: absolute; 77 top: 50%; 78 left: 20px; 79 transform: translateY(-50%); 80 -webkit-transform: translateY(-50%); 81 -webkit-writing-mode: vertical-rl; 82 -ms-writing-mode: tb-rl; 83 writing-mode: vertical-rl; 84 font-size: 10px; 85} 86 87/* --------arrowアニメーション設定 */ 88.arrowWrap { 89 position: absolute; 90 right: 15px; 91 bottom: 0; 92 height: 200px 93} 94.arrowInner p { 95 font-size: 12px; 96 color: #000; 97 text-shadow:none; 98 text-align: end; 99 -webkit-transform: rotate(90deg); 100 transform: rotate(90deg); 101} 102.arrow { 103 width: 2px; 104 height: 2000px; 105 margin: 20px auto 0; 106 position: relative; 107 overflow: hidden; 108} 109.arrow::before { 110 content: ''; 111 width: 2px; 112 height: 100px; 113 margin: 50px auto 0; 114 background-color: #000; 115 position: absolute; 116 top: -150px; 117 left: 0; 118 -webkit-animation: arrow 3s ease 0s infinite normal; 119 animation: arrow 2.5s ease 0s infinite normal; 120} 121@keyframes arrow { 122 0% { 123 -webkit-transform: translate3d(-50%, 0, 0); 124 transform: translate3d(-50%, 0, 0); 125 } 126 60% { 127 -webkit-transform: translate3d(-50%, 100px, 0); 128 transform: translate3d(-50%, 100px, 0); 129 } 130 100% { 131 -webkit-transform: translate3d(-50%, 100px, 0); 132 transform: translate3d(-50%, 100px, 0); 133 } 134}
回答1件
あなたの回答
tips
プレビュー