text-align: center;
margin: 0 auto;
display: inline-block;
{ display: flex; justify-content: center; }
{ padding-bottom: 20px; padding-top: 20px; }
{ height: 100px; line-height: 100px; }
table
去吗 配吗 这褴褛的披风 战吗 战啊 以最卑微的梦 致那黑夜中的呜咽与怒吼 |
{ display: table-cell; vertical-align: middle; }
{ display: flex; justify-content: center; flex-direction: column; }
::before
去吗 配吗 这褴褛的披风 战吗 战啊 以最卑微的梦 致那黑夜中的呜咽与怒吼
postion、top
postion、top、transform
{ display: table-cell; vertical-align: middle }
{ display: flex; flex-direction: column; justify-content: center }
postion、top、left、margin
postion、top、left、transform
{ display: flex; justify-content: center; align-items: center; }
{ display: grid; justify-items: center; align-items: center; }