はじめに、headにメニューバーを作成し、bodyで画像を全画面表示させ、footerをつけました。
その時は、正常に表示されていたのに、bodyにさらに、二つ目の画像を入れたら、footerが正しく表示されなくなってしまいました。
私は、LPのような長めのものを作りたいと思ってるのですが、bodyの量が増えると、footerが正しく表示されなくなるようです。
間違っている部分を教えていただきたいです。
html
1```<!DOCTYPE html> 2<html lang="ja"> 3 <head> 4 <meta charset="utf-8"> 5 <meta http-equiv="X-UA-Compatible" content="IE=edge"> 6 <meta name="viewport" content="width=device-width, initial-scale=1"> 7 <title>otokofes19.work</title> 8 <!-- fontawesomeの読み込み --> 9 <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.5.0/css/all.css" integrity="sha384-B4dIYHKNBt8Bc12p+WXckhzcICo0wtJAoU8YZTY5qE0Id1GSseTk6S+L3BlXeVIU" crossorigin="anonymous"> 10 <!-- cssの読み込み --> 11 <link rel="stylesheet" href="stylesheet.css"> 12 <!-- BootstrapのCSS読み込み --> 13 <link href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous"> 14 <!-- jQuery読み込み --> 15 <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script> 16 <script type="text/javascript" src="otokofes.js"></script> 17 18 <!-- BootstrapのJS読み込み --> 19<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js" integrity="sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy" crossorigin="anonymous"></script> 20 </head> 21 <body> 22 <nav class="navbar navbar-expand-md"> 23 24 <div class="col-md-12 collapse navbar-collapse" id="example"> 25 <ul class="navbar-nav"> 26 <li> 27 <a class="nav-link" href="https://www.grisoluto.com/entry/otoko-matsuri">ABOUT US</a> 28 </li> 29 <li> 30 <a class="nav-link" href="#">MEMBER</a> 31 </li> 32 <li> 33 <a class="nav-link" href="https://otokofes2019.tumblr.com/">DAIRY PHOTO</a> 34 </li> 35 <li> 36 <a class="nav-link" href="#">LAST YEAR MOVIE</a> 37 </li> 38 <li> 39 <a class="nav-link" href="#">HOT INFORMATION</a> 40 </li> 41 </ul> 42 </div> 43</nav> 44 45 <div class="top container-fluid"> 46 <div class="row float-none"> 47 <img src="images/IMG_3005000.jpg" class="img-fluid center-block "> 48 </div> 49 </div> 50 51 <section class="whistlecafe"> 52 <img src="images/3whistle..koukoku-01.jpg" class="img-fluid center-block > 53 </section> 54 <footer style="background-color:gray"> 55 <div class="copyright"> 56 <p>© 2019 - otokofes2019実行委員</p> 57</div> 58<div class="sns"> 59 <a href="https://note.mu/otokofes19" class="contact">Note</a> 60 <a href="https://www.facebook.com/otokofes2019/" class="fb"><i class="fab fa-facebook-square"></i></a> 61 <a href="https://twitter.com/otokofes19" class="tw"><i class="fab fa-twitter"></i></a> 62 <a href="https://www.instagram.com/otokofes19" class="insta"><i class="fab fa-instagram"></i></a> 63</div> 64 65 </footer> 66 </body> 67</html> 68```css 69コード 70```@charset "utf-8"; 71.navbar .navbar-nav .nav-link { 72 color: #fff; /* テキストカラー */ 73} 74.navbar { 75 background-color: #6c757d; /* 背景色 */ 76} 77 78.whistlecafe img{ 79 max-width: 40%; 80 height: auto; 81} 82 83 84footer { 85 position: fixed; 86 bottom: 0; 87 display: inline-block; 88 width: 100%; 89 height: 70px; 90 margin: 0; 91 background-color: #9E9E9E; 92 box-shadow: 0 -3px 3px 0 rgba(0,0,0,0.2); 93} 94footer .copyright { 95 float: left; 96 width: 60%; 97} 98footer .copyright p { 99 font-size: 0.7em; 100 line-height: 70px; 101 padding-left: 10%; 102 letter-spacing: 1px; 103 color: #ffffff; 104} 105footer .sns { 106 float: right; 107 width: 40%; 108} 109footer .sns a { 110 width: 25%; 111 font-size: 1.2em; 112 font-weight: bold; 113 line-height: 70px; 114 float: left; 115 -webkit-transition: all, 0.3s; 116 transition: all, 0.3s; 117 text-align: center; 118 text-decoration: none; 119 color: white; 120} 121footer .sns a:hover { 122 -webkit-transition: all, 0.3s; 123 transition: all, 0.3s; 124 background-color: #222222; 125} 126footer .sns .insta { 127 background-color: #e4405f; 128} 129footer .sns .fb { 130 background-color: #3b5999; 131} 132footer .sns .tw { 133 background-color: #55acee; 134} 135footer .sns .contact { 136 background-color:#7BC5AE; 137} 138@media (max-width: 480px) { 139 .contents { 140 margin-bottom: 200px; 141 } 142 footer { 143 height: auto; 144 } 145 footer .copyright { 146 width: 100%; 147 } 148 footer .copyright p { 149 padding: 0; 150 text-align: center; 151 } 152 footer .sns { 153 width: 100%; 154 } 155} 156 157
コード
回答2件
あなたの回答
tips
プレビュー