CSS让高度百分百的方案

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

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

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

position: fixed;
top: 0px;
bottom: 0px;
margin: auto;
posted @ 2019-11-26 22:54  Nayek  阅读(575)  评论(0编辑  收藏  举报