首页 > 网站底部怎么样才能不随分辨率的增大变换位置

网站底部怎么样才能不随分辨率的增大变换位置


不就是footer 沉底么,我一直用的

//页面布局
html
    body
        <div class="page-bg"></div>
        <footer></footer>
    body
html
//不用响应式的话就这样
html,body{
    height:100%;
}
.page-bg{
       min-height: 100%;
       height: auto !important;
       padding-bottom: 80px; //都是80,自己定义footer高度
    }
footer{
    height:80px; //都是80
    margin-top:-80px; //都是80
}
//用响应式,那就每个breakpoint下给高度重新设置一下,平板以下基本就不用设置高度了,自动就好,主要看设计

把底部弄成position:fixed啊


用js获取body高度,然后设置foot的位置 这样可以适应不同分辨率


http://jsbin.com/fefive/1/edit?html,css,js,output


fixed定位在viewport底部或者absolute定位在祖先定位元素底部


<style>
.po{ position:absolute; left:200px; top:300px; width:500px; height:300px; background:#ccc;}
</style>
<div class="po"></div>

绝对定位?position:absolute;


宽度位置么?你可以写百分比的位置啊


如果是高度的话可以用js获取屏幕高度再做位置计算,或者底部弄成绝对靠底部。


分辨率增大影像位置是指分辨不同造成的元素显示大小不同么


搜索 sticky footer

【热门文章】
【热门文章】