元素水平垂直居中
HTML
<body>
<div id="app">
<div>
元素水平垂直居中
</div>
</div>
</body>
CSS
<style>
body{
position: fixed;
margin: 0;
padding: 0;
width: 100%;
height: 100%;
}
#app{
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
height: 100%;
}
</style>