Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我没有为身体设置高度 - 我只是希望包装器在身体内自动垂直居中。任何帮助将不胜感激。
您可以使用几个包装<div>元素并使用display: table,display: table-cell和vertical-align: middle.
<div>
display: table
display: table-cell
vertical-align: middle
jsFiddle