1.用百分比加 相对定位,绝对定位,布局PC端,能最高程度达到自适应
2.最外层用一个DIV container作为 最外层,用相对定位position reletive ,width 100
内部用一个DIV content作为内容容器,用绝对定位
position absolute
bottom 0
top 0
left 0
right 0
width 100
height 100
之后的html都写在content容器内,且 width height margin top 等都用百分比,做到适配PC的效果,当屏幕变化时,每个元素都会随之变化大小做到适配屏幕。个人还是不要做这种适配,还是屏幕小的情况下,显示屏幕中间的部分比较合理
3.如若没有实现,尝试加上以下代码
html {
height: 100%;
display: table;
}
body {
display: table-cell;
height: 100%;
}