概要
フッターの下部の余白(付属画像のような感じです)が消えなくて困っています。
以下のサイトを参考にしました。
CSSでフッターをウィンドウ最下部に固定する方法【初心者向け】 | TechAcademyマガジン
gridでフッターの下部の余白を無くす方法。
CSSでフッターの下に隙間ができないようにメインコンテンツの高さを調整する
TechAcademyマガジンの方のやり方で以下のコードを追加でも消えません。
footer {height: 22px;bottom: 0; /下に固定/position: absolute;/←絶対位置/}
.wrapper{
min-height: 100%;/* ページ全体の高さを指定 */
position: relative;/←相対位置/
padding-bottom: 22px;/←footerの高さ/
box-sizing: border-box;/←全て含めてmin-height:100vhに/
}
html
1<!DOCTYPE html> 2 3<html lang="ja"> 4 5<head> 6 <meta content="text/html; charset=utf-8" /> 7 <meta name="viewport" content="width=device-width, initial-scale=1"> 8 9 <link rel="stylesheet" href="bbb.css"> 10 <title>1ページ目</title> 11 <style> 12</style> 13 14</head> 15<body> 16<div class="wrapper"> 17 18<!--空白の設定--> 19<div class="kuuhaku50"> 20</div> 21 22 23<footer> 24 <small><a href="" class="sss10"><span>概要説明の詳細ページに進む </span></a> <a class="sss11"><span>Copyright ©.All Right Reserved.</span></a></small> 25</footer> 26 27</div> 28<!--overflow:hiddenここまで適応div--> 29 </body> 30</html> 31
css
1html, body { 2 height: 100%; 3} 4 5 6.wrapper { 7 overflow: hidden; 8} 9 10/* footerのスタイルと英語の文字のスタイルなど */ 11footer { 12 13 padding-top: 4px; 14 padding-right: 0px; 15 padding-bottom: 3px; 16 padding-left: 0px; 17 background-color: rgb(7, 206, 0); 18 color: white; 19 font-size: 12px; 20 font-weight: 500; 21 width:100%; 22 height: 22px; 23 24 text-align: center; 25 bottom: 0; /*下に固定*/ 26 vertical-align: bottom; 27 position: absolute;/*←絶対位置*/ 28 } 29 30 31 32 33 .wrapper{ 34 min-height: 100%;/* ページ全体の高さを指定 */ 35 position: relative;/*←相対位置*/ 36 padding-bottom: 22px;/*←footerの高さ*/ 37 box-sizing: border-box;/*←全て含めてmin-height:100vhに*/ 38 } 39 40 41 42 /* 最下部のリンクのスタイル */ 43 .sss10{ 44 text-decoration:none;/* 下線消去 */ 45 color: white;/* 色の変更 青から白 */ 46 font-size: 14px; 47 48 49 50 51 } 52 53 /* リンクを訪問後の色の解除 */ 54.sss10:visited{ 55 color: white;/* 色の変更 青から白 */ 56 text-decoration:none;/* 下線消去 */ 57 58 59} 60/* リンクにカーソルを当てた時の色の変化を無効にする */ 61.sss10:hover{ 62 text-decoration:none;/* 下線消去 */ 63 color: white;/* 色の変更 青から白 */ 64} 65 66 67.sss11{ 68 69 color: white; 70 font-size: 14px; 71 72 73 74} 75

回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。