CSS让高度百分百的方案

一般用来上下所有居中,但是这时候auto的计算是全屏像素,从而得到满屏

position: fixed;
left: 0px;
right: 0px;
top: 0px;
bottom: 0px;
margin: auto;

单纯高度的话,只要把left,right去掉即可

position: fixed;
top: 0px;
bottom: 0px;
margin: auto;

猜你喜欢

转载自www.cnblogs.com/nayek/p/11939048.html