在相对的空间内,垂直居中。position: relative;top: 50%;transform: translateY(-50%); 无论内容怎么增加,全文都是垂直居中的。 转载于:https://www.cnblogs.com/peko/p/7473219.html