目標:我正在嘗試實現如腳本on this page所述的CSS腳註。頁腳不會一直延伸到頁面的右邊緣
問題:頁腳未觸及頁面的右側邊緣。
我有我的頁面剝離下來仍出現此問題,下面簡單的情況:
HTML:
<!DOCTYPE html>
<html lang="en">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css">
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js" ></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
<link href="my.css" rel="stylesheet">
</head>
<body>
<div class="row footer">
</div> <!-- end of row footer -->
</body>
</html>
CSS:
html {
height: 100%; /* the footer needs this */
box-sizing: border-box;
}
body {
position: relative;
padding-top: 80px;
padding-bottom: 100px; /* the footer needs this */
min-height: 100%; /* the footer needs this */
}
.footer { /* footer trick learned from https://codepen.io/cbracco/pen/zekgx */
position: absolute;
bottom: 0;
width: 100%;
height: 100px;
background-color: #eee;
}
我怎樣才能讓頁腳延長一直到右邊?起初我以爲這與Boostrap(我在頁面的「真實」版本中使用)有關,但這似乎不是原因。
我試着添加「padding-right:0」到頁腳類,但它沒有效果。
請在某處創建[mcve]。 – CBroe
所以你需要文字對齊? –