###前提・実現したいこと
footerの下に余白があく。余白を0pxもあかないようにしたい。
###発生している問題・エラーメッセージ
特にエラーは発生していない。
###該当のソースコード
htmlには
<html lang="ja"> <head> <meta charset="utf-8"> <link rel="stylesheet" href="index.css"> </head> <body> <header class="clearfix"> <nav> <h1 class="title">WEB SITE</h1> <ul class="top-menu"> <li class="top-menu-item"><a class="button-primary" href="/accounts/login">LOGIN</a></li> </ul> </nav> </header> <main> <div class="container"> <div class="col-lg-6 col-md-12"> <p>Hello world</p> </div> </div> </main> </body> <footer> <nav> <ul class="bottom-menu"> <li class="bottom-menu-item"><a class="bottom_index" href="">ご利用規約</a></li> </ul> </nav> </footer> </html>
と書いた。
index.cssには
*{ margin: 0; padding: 0; } header{ height: 100px; background-color: black; } footer{ height: 50px; width: 100%; background-color: black; bottom:0; } .bottom-menu-item{ list-style: none; font-size: 15px; } .bottom_index { color: white; }
と書いた。
###試したこと
cssのfooterタグに
footer{ height: 50px; width: 100%; background-color: black; position:absolute; bottom:0; }
と書いたが、フッターがbodyの場所に行き逆に変な位置に移動した。
当方で試したところ、隙間が開かず問題が再現しませんでした。ここでいう「隙間」とは、何と何との間の隙間のことですか? もしかしてfooterとwindow枠との間の隙間ですか?
回答3件
あなたの回答
tips
プレビュー