目标:我正在尝试实现如脚本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
所以你需要文字对齐? –