(上一个问题修复了更新为新问题的问题) mainContent div现在扩展到它与页脚之间的传送带div的后面。div在另一个div后面扩展
CSS样式1:
body {
height:100%;
display: flex;
flex-direction: column;
height: 100%;
color: #000305;
line-height: 1.429;
margin: 0;
padding: 0;
text-align: left;
}
.mainContent {
height:100%;
flex: 1;
position: relative;
background-color: #333;
overflow: hidden;
line-height: 25px;
}
.mainFooter {
position: relative;
right: 0;
bottom: 0;
left: 0;
height: 150px;
width: 100%;
float: left;
padding-left: 0;
background-color: #000;
color: #CCC;
}
CSS样式2:
.list_carousel {
background-color: #222;
}
有用于传送带更多的CSS class和id,但是这是编辑div的,只有一个,如你所见,它没有高度或位置的设置。当我将位置固定时,它落在页脚下方,没有滚轮。
因此,现在mainContent div扩展到浏览器的底部,div内的一些内容现在隐藏在mainContent之下的div之后,例如旋转木马,甚至在页脚后面。
你有'高度:100%'的HTML元素?请参阅:[使用CSS'height'属性和百分比值](http://stackoverflow.com/a/31728799/3597276) –
[Twitter Bootstrap 3 Sticky Footer]的可能重复(http://stackoverflow.com/问题/ 17966140/twitter-bootstrap-3-sticky-footer) – henry
您正在寻找的搜索字词是“bootstrap sticky footer” - 这里有几个SO问题。简短的回答是https://getbootstrap.com/examples/sticky-footer/ – henry