4.30

4.30
垂直居中:
1.单行文本垂直居中(行高方法)
height: 500px;
line-height: 500px;

1

2.单行多行固定高度文本垂直居中(flex方法)
display: flex;
align-items: center;

2

3.单行多行适用不固定高度(padding方法)
padding-top: 150px;
padding-bottom: 150px;

3

posted @ 2026-04-30 09:28  Srr1116  阅读(17)  评论(0)    收藏  举报