下記は、レスポンシブサイトです。
スライドショーの部分なのですが、ウインドウサイズを小さくすると下に大きな隙間ができてしまいます。
隙間を無くす方法はありますでしょうか?
Chromeの検証機能を使って調べてみても隙間が無い事になっていて、原因も不明です。
<HTML>
<!DOCTYPE HTML><html> <head> <link rel="stylesheet" type="text/css" href="css/main_style.css"> <meta charset="UTF-8"> <title>株式会社テスト</title> </head> <body> <header> <nav class="clearfix"> <!-- logo --> <div class="logo"> <h1><a href="index.html"><span>株式会社テスト</span></a></h1> </div> <!-- logo --> <ul> <li class="menu01"><a href="#">ホーム<br> <span>HOME</span></a></li> <li class="menu02"><a href="#">会社概要<br> <span>COMOPANY</span></a></li> <li class="menu03"><a href="#">事業内容<br> <span>WORKS</span></a></li> <li class="menu04"><a href="#">ニュース<br> <span>NEWS</span></a></li> <li class="menu05"><a href="#">採用情報<br> <span>RECRUIT</span></a></li> <li class="menu06"><a href="#">お問い合わせ<br> <span>CONTACT</span></a></li> </ul> </nav> </header> <section class="main_slide"> <div class="slide"> <img src="img/slideshow/slide1.jpg"> <img src="img/slideshow/slide2.jpg"> <img src="img/slideshow/slide3.jpg"> <img src="img/slideshow/slide4.jpg"> <img src="img/slideshow/slide5.jpg"> </div> </section> <section> <!-- company_dscription --> <div id="company_discription"> <p>あなたのビジネスパートナー</p> </div> <!-- company_dscription --> </section> </body> </html>
<CSS>
@media all and (min-width: 608px) { * { margin:0; padding:0; } body { color:#333; margin: 0; } .logo { float:left; width:250px; padding-right:20px; } a:hover { transition: 0.5s ; background: #EEE; opacity: 0.4; filter: alpha(opacity=40); -ms-filter: "alpha(opacity=40)"; } h1 { width:250px; height:71px; background-image:url("../img/logo.png"); background-repeat:no-repeat; } h1 span { display:none; } h1 a { display:block; width:250px; height:71px; } nav { background-color:#fff; padding-top:10px; display: flex; justify-content: center; height: 83px; /* 高さ */ width: 100%; /* 長さ */ position: fixed; /* ヘッダーを固定(これが重要) */ top: 0; /* 固定する位置 */ left: 0; /* 固定する位置 */ right: 0; /* 固定する位置 */ box-shadow: 0 3px 3px 0 rgba(0, 0, 0, 0.2); -webkit-box-shadow: 0 3px 3px 0 rgba(0, 0, 0, 0.2); -moz-box-shadow: 0 3px 3px 0 rgba(0, 0, 0, 0.2); z-index:1 } nav li { list-style:none; float:left; text-align:center; overflow: hidden; } nav .menu01, .menu02, .menu03, .menu04, .menu05, .menu06 { width:125px; background-color:#FFF; font-weight:bold; } nav .menu02, .menu03, .menu04, .menu05, .menu06 { border-left: solid 1px #CCC; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; -o-box-sizing: border-box; -ms-box-sizing: border-box; box-sizing: border-box; } nav a { width:100%; display:block; } nav span { color:#CCC; font-weight:100; line-height:3em; } nav a:link { color: #333; } nav a:visited { color: #333; } nav a:hover { color: #333; } nav a:active { color: #333; } a { text-decoration:none; } .clearfix { *zoom: 1; } .clearfix:after { content: ''; display: table; clear: both; } /*スライダー*/ /*=== 画像の表示エリア ================================= */ .main_slide { position : relative; overflow : hidden; background-color:blue; padding-top:93px; height:600px; } .slide { } /*=== 画像の設定 ======================================= */ .slide img { display: block; position : absolute; max-width:100%; left:100%; animation : slideAnime 15s ease infinite; margin-left: 50%; transform: translateX(-50%); } #company_discription { background-image:url(../img/sc2_nk_flag_bg.jpg) ,url(../img/sc2_nk_flag_bg_1px.jpg); background-repeat: no-repeat, /* 最前面の背景レイヤーに対応 */ repeat; /* 再背面の背景レイヤーに対応 */ height: 150px; display: flex; justify-content: center; /*左右中央揃え*/ align-items: center; /*上下中央揃え*/ } #company_discription p { text-align:center; color:#faee00; font-size:36px; font-weight:bold; } /*=== スライドのアニメーションを段差で開始する ========= */ .slide img:nth-of-type(1) { animation-delay: 0s } .slide img:nth-of-type(2) { animation-delay: 3s } .slide img:nth-of-type(3) { animation-delay: 6s } .slide img:nth-of-type(4) { animation-delay: 9s } .slide img:nth-of-type(5) { animation-delay: 12s } /*=== スライドのアニメーション ========================= */ @keyframes slideAnime { 0% { left: 100% } 1% { left: 0 } 19% { left: 0 } 20% { left: -100% } 100% { left: -100% } } }
.slide img { display: block; position : absolute; max-width:100%; left:100%; animation : slideAnime 15s ease infinite; margin-left: 50%; transform: translateX(-50%); }
ここのmax-widthをmax-width:1280pxと画像の横幅サイズをしていすると以下のように
次の画像がかぶさって表示されます。

回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
退会済みユーザー
2018/03/16 14:56
2018/03/16 14:59
退会済みユーザー
2018/03/16 15:22
2018/03/16 15:31
退会済みユーザー
2018/03/16 15:38
退会済みユーザー
2018/03/16 15:39
2018/03/16 15:45
退会済みユーザー
2018/03/16 15:50
2018/03/16 16:01
退会済みユーザー
2018/03/16 16:25
2018/03/16 16:26
退会済みユーザー
2018/03/16 17:07 編集
退会済みユーザー
2018/03/16 17:08
退会済みユーザー
2018/03/16 17:12
2018/03/16 17:23
退会済みユーザー
2018/03/16 17:31
2018/03/16 17:36 編集
退会済みユーザー
2018/03/16 17:53 編集