いつもお世話になっております。
以前に似たような質問をしたのですが、違うページにて問題を解決できなかったため改めて質問させていただきました。
サイトのフッター下に微妙な余白ができており、そこを詰めてフッターを表示するようにしたいのですが、どうもうまくできません。
何が原因になっているかを知りたいため、もしピンと来るものがあったら教えていただけないでしょうか。
※ブラウザのソース表示のものを貼っているため不恰好になってしまっています。
申し訳ありません。
<div class="search_result"> <br> <div class="result_phrase"> </div> <br> <br> <a href="recipe-detail?recipe_id=RC081517508091_001"> <div id="search_result_block1"> <div class="img"> <img src=http://vccw.test/wp-content/themes/lightning-child/images/test/RC081517508091_001.jpg> </div> <div id="search_result_block2" align="left"> <p>テスト</p> <p class="p3"><span class="p4">テスト</span>テスト</p> </div> <br> <div id="search_result_block3" align="left"> <p>テスト</p> </div> </a> </div> <br> </div> <nav id ="page_link"> 1 <a href=?type=genre&page_no=2&genre=RICE class="home"><span>2</span></a> <a href=?type=genre&page_no=3&genre=RICE class="home"><span>3</span></a> <a href=?type=genre&page_no=2&genre=RICE class="home"><span>次のページ→</span></a></nav> <footer class="section siteFooter"> <div class="footerMenu"> <div class="container"> </div> </div> <div class="container sectionBox"> <div class="row "> <div class="col-md-4"><aside class="widget widget_text" id="text-7"> <div class="textwidget"><p><a href="http://www.materic.jp/terms_of_service/">利用規約</a><br /> <a href="http://www.test/">お問い合わせ</a></p> </div> </aside></div><div class="col-md-4"></div><div class="col-md-4"></div> </div> </div> </footer> <div id="fb-root"></div>
CSS
1html { 2 height: 100%; 3} 4 5body { 6 height: 100vh; 7 display: flex; 8 flex-direction: column; 9 background-color: #ffffe1; 10} 11 12div.search_result { 13 text-align: center; 14 flex: 1; 15} 16 17div.search_result h1 { 18 font-size: 1.2em; 19 margin : 100px 0px -45px 0px; 20} 21 22div.search_result a { 23 text-decoration: none; 24 color : #000000; 25} 26 27div.result_phrase { 28 font-size: 1.5em; 29 margin-top : 20px; 30 margin-bottom: -30px; 31} 32 33#search_result_block1 { 34 margin: 0 auto; 35 background: white; 36 border-style : solid; 37 border-width : 1px; 38 width : 600px; 39 height : 200px; 40 border-color : gray; 41 -moz-border-radius: 5px; 42 -webkit-border-radius: 5px; 43 border-radius: 5px; 44 45} 46 47#search_result_block2 { 48 margin-top : 10px; 49 margin-left : 200px; 50 background : #fff9fc; 51 border-style : solid; 52 border-width : 1px; 53 width : 388px; 54 font-size : 20px; 55 height : 110px; 56 border-color : gray; 57} 58 59#search_result_block2 p { 60 color: #9cbb1c; 61 font-size: 1.4em; 62 margin-left: 3px; 63 margin-bottom : 0px; 64 text-decoration: underline; 65 font-weight:bold; 66} 67 68#search_result_block2 .p1 { 69 color: #9cbb1c; 70 font-size: 1.2em; 71 margin-left: 3px; 72 margin-bottom : 0px; 73 text-decoration: underline; 74 font-weight:bold; 75} 76 77#search_result_block2 .p2 { 78 color: #9cbb1c; 79 font-size: 0.9em; 80 margin-left: 3px; 81 margin-bottom : 0px; 82 text-decoration: underline; 83 font-weight:bold; 84} 85 86#search_result_block2 .p3 { 87 font-size: 0.8em; 88 margin-left: 3px; 89 margin-top : 0px; 90 color: #ff7f50; 91 text-decoration: none; 92 font-weight:bold; 93} 94 95#search_result_block2 .p4 { 96 font-size: 1.0em; 97 margin-top : 0px; 98 color: gray; 99 text-decoration: none; 100 font-weight:bold; 101} 102 103#search_result_block3 { 104 margin-bottom : 10px; 105 margin-left : 200px; 106 margin-top : -15px; 107 background :#fff9fc; 108 border-style :solid; 109 border-width : 1px; 110 width :388px; 111 height : 63px; 112 border-color :gray; 113} 114#search_result_block3 p { 115 margin-left: 3px; 116 font-size : 10px; 117} 118 119.section.siteFooter{ 120 background:white; 121 color:#ffffff; 122}
別のページにて解決できた時には、コンテンツ全体を囲むdivに対してflex: 1 0 auto;を設定することで対応できました。
しかし、今回提示したPHPについてdivで全体を囲って同じ指定をしても余白が消えることはありませんでした...
わかりづらい質問となってしまい大変申し訳ありませんが、どうかよろしくお願いします。
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2018/05/24 08:03
2018/05/24 08:11
2018/05/24 08:29
2018/05/24 08:43 編集
2018/05/28 06:53