div 内容垂直居中

HSdiana 2020-03-28

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <div style="width: 200px;height: 200px;border: solid red 1px;display: flex;align-items: center;">
        <div>sdsfs</div>
    </div>
</body>
</html>

div 内容垂直居中

相关推荐