###前提・実現したいこと
CSSのみでメイン画像5枚をスライドショーをで表示させたい
###発生している問題・エラーメッセージ
PCではやりたいことが実現できましたがスマホ(iphone)で確認をすると動作が異なってしまいます。
レスポンシブで対応を行いたいです。
###該当のソースコード
html
1 <div class="mainPhoto"> 2 <div class="mainshow"> 3 <section class="slideA"> 4 <p class="one">違<span>いのわかる</span>大人<span>の</span>ヘアサロン</p> 5 <img src="<?php echo get_template_directory_uri(); ?>/img/main1.jpg" width="963" height="457" alt=""/> 6 </section> 7 <section class="slideB"> 8 <p class="one">違<span>いのわかる</span>大人<span>の</span>ヘアサロン</p> 9 <img src="<?php echo get_template_directory_uri(); ?>/img/main2.jpg" width="963" height="457" alt=""/> 10 </section> 11 <section class="slideC"> 12 <p class="one">違<span>いのわかる</span>大人<span>の</span>ヘアサロン</p> 13 <img src="<?php echo get_template_directory_uri(); ?>/img/main3.jpg" width="963" height="457" alt=""/> 14 </section> 15 <section class="slideD"> 16 <p class="one">違<span>いのわかる</span>大人<span>の</span>ヘアサロン</p> 17 <img src="<?php echo get_template_directory_uri(); ?>/img/main4.jpg" width="963" height="457" alt=""/> 18 </section> 19 <section class="slideE"> 20 <p class="one">違<span>いのわかる</span>大人<span>の</span>ヘアサロン</p> 21 <img src="<?php echo get_template_directory_uri(); ?>/img/main5.jpg" width="963" height="457" alt=""/> 22 </section> 23 </div> 24 </div>
css
1main{ 2 width: 960px; 3 padding-top:150px; 4 padding-bottom: 50px; 5 margin: 0 auto; 6 overflow: hidden; 7} 8main .mainPhoto{ 9 display: block; 10 margin: 0 auto; 11 width: 100%; 12 height: auto; 13 max-width: 960px; 14 position: relative; 15} 16.mainshow p { 17 display: inline-block; 18 position: absolute; 19 top: 20px; 20 left: 20px; 21 font-family:"Tsukushi A Round Gothic","筑紫A丸ゴシック"; 22 font-weight:lighter; 23 font-size: 3.6rem; 24 text-shadow: 25 0 0 5px #edf8ff, 26 0 0 10px #edf8ff, 27 0 0 15px #edf8ff, 28 0 0 20px #edf8ff, 29 0 0 25px #edf8ff, 30 0 0 30px #edf8ff, 31 0 0 35px #edf8ff, 32 0 0 40px #edf8ff, 33 0 0 45px #edf8ff, 34 0 0 50px #edf8ff; 35} 36.mainPhoto span { 37 font-size: 2.0rem; 38} 39 40 41 42 43.mainshow section { 44-webkit-animation: autoplay 30s infinite; 45animation: autoplay 30s infinite; 46} 47.mainshow .slideA { 48position: absolute; 49-webkit-animation-delay: 0; 50animation-delay: 0; 51} 52.mainshow .slideB { 53position: absolute; 54-webkit-animation-delay: -24s; 55animation-delay: -24s; 56} 57.mainshow .slideC { 58position: absolute; 59-webkit-animation-delay: -18s; 60animation-delay: -18s; 61} 62.mainshow .slideD { 63position: absolute; 64-webkit-animation-delay: -12s; 65animation-delay: -12s; 66} 67.mainshow .slideE { 68position: absolute; 69-webkit-animation-delay: -6s; 70animation-delay: -6s; 71} 72 73@keyframes autoplay { 740% { transform: translateX(0); } 7516% { transform: translateX(0); } 7620% { transform: translateX(-100%); } 7720.001% { transform: translateX(100%); } 7896% { transform: translateX(100%); } 79100% { transform: translateX(0); } 80} 81 82 83@media only screen and (max-width:480px){ 84.mainPhoto img{ 85 width: 100%; 86 height: auto; 87} 88.mainPhoto p { 89 font-size: 2.0rem 90} 91.mainPhoto span { 92 font-size: 1.3rem; 93} 94} 95
よろしくお願い致します。