qjuly
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>垂直居中</title>
    <style>
        .container {
            position: absolute;
            width: 400px;
            height: 200px;
            background-color: orange;
            left: 50%;
            top: 50%;
            transform: translate(-50%,-50%);
        }
    </style>
</head>
<body>
<div class="container"></div>

分类:

技术点:

相关文章:

  • 2021-04-03
  • 2021-05-18
  • 2022-02-22
  • 2021-05-27
  • 2022-01-02
  • 2021-12-09
  • 2021-12-31
猜你喜欢
  • 2021-08-13
  • 2022-01-14
  • 2022-02-20
  • 2022-01-28
  • 2022-12-23
  • 2021-12-04
  • 2021-12-01
相关资源
相似解决方案