我无法弄清楚如何让页脚粘到底部。如果内容小于尺寸页脚应该在底部&如果内容大于窗口大小,页脚应该在内容的结尾。我知道互联网上有大量的材料,如何将脚注粘到底部。下面的代码工作正常时,内容大:页脚应该在页面底部/内容
这里是我的HTML:
<html>
<body ng-cloak>
<notifications-bar class="notifications"></notifications-bar>
<div ng-controller="MainCtrl as main">
<ng-include src="'app/layout/header.html'"></ng-include>
<div ng-view></div>
<ng-include src="'app/layout/footer.html'"></ng-include>
</div>
<spinner></spinner>
</body>
</html>
这里是CSS:
* {
margin: 0;
}
html { position: relative; min-height:100%;
}
html, body { margin:0px; padding:0px;
}
.footer_body {
background-color: rgb(102, 102, 102);
margin:0px;
position: relative;
top: 0px;
bottom: 0px;
width: 100%;
}
为了让您的页脚固定在底部,位置:固定;底部:0; –