我有一个像这样的CSS盒子模型:
使用jQuery(当一个按钮被隐藏时)我调整了我的Main Content Div的大小,但页脚没有保持在屏幕底部的位置:
我尝试将position: fixed
设置为页脚div,但它不会随页面滚动。
我想知道是否有办法定位页脚,无论内容是什么
答案 0 :(得分:0)
使用css实现此目的
.my_footer {
position: fixed;
bottom: 0;
left: 0;
right: 0;
height: 100px;
}
答案 1 :(得分:0)
尝试这个
CSS
.footer{
background-color:#76D6FF;
position:fixed;
bottom:0;
width:100%;
height:100px;
}
HTML
<div class="footer">footer</div>
答案 2 :(得分:0)
试试这个:
.class_name {
width:100%;
height:100px;
position:fixed;
bottom:0;
background-color: #CCC;
}