这样子对吗

来源:2-10 编程练习

慕雪9046520

2020-04-08 10:46:51

<!DOCTYPE html>

<html lang="en">

<head>

    <meta charset="UTF-8">

    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <title>Document</title>

    <style>

        .per{

            width: 300px;

            height: 300px;

            background-color: red;

            margin-top: 200px;

            margin-left: 200px;

            position: relative;

        }

        .son{

            width: 100px;

            height: 100px;

            background-color: blue;

            top: 0;

            left: 0;

            right: 0;

            bottom: 0;

            margin:auto auto;

            position:absolute;

        }

    </style>

</head>

<body>

    <div class="per">

        <div class="son"></div>

    </div>

</body>

</html>


写回答

1回答

好帮手慕久久

2020-04-08

同学你好,代码是正确的,很棒,祝学习愉快!

0

0 学习 · 40143 问题

查看课程

相似问题