用什么代码实现?不允许有白色底色产生,因为手机高度不一样
错误的写法:加到div中结合图片设置min-height,但是页面不会回弹
话不多说直接上代码
终极方案
html,body{
width:100%;
height:100%
}
再加一段
body{
font-family: "华文细黑";
background:url("../img/Flyer-bg.png") no-repeat;
background-size: 100%;
}
就是这么简单,但是好多人想不到。
一个hack方案解决垂直剧中问题
缓存.parent{
width:200px;
height: 200px;
/* 以下属性垂直居中 */
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
margin: auto;
background-color: #aaa;
}
111
其他方案
Document