Blogger Information
Blog 32
fans 0
comment 0
visits 22689
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
0705相对定位与绝对定位的区别与联系
Yx的博客
Original
841 people have browsed it

实例

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <style type="text/css">
        .parent {
            position: relative;
            border: 1px dashed gray;
            width: 450px;
            height: 450px;

        }

        .box1 {
            width: 150px;
            height: 150px;
            background-color: lightblue;
            border-radius: 50%;
        }

        .box2 {
            width: 150px;
            height: 150px;
            background-color: lightgray;
            border-radius: 50%;
        }

        .box3 {
            width: 150px;
            height: 150px;
            background-color: lightgreen;
            border-radius: 50%;
        }

        .box4 {
            width: 150px;
            height: 150px;
            background-color: lightcoral;
            border-radius: 50%;
        }

        .box5 {
            width: 150px;
            height: 150px;
            background-color: lightseagreen;
            border-radius: 50%;
        }

        .box1 {
            position: absolute;
            left: 150px;
            border-radius: 50%;
        }

        .box2 {
            position: absolute;
            top: 150px;
            border-radius: 50%;
        }

        .box3 {
            position: absolute;
            left: 300px;
            top: 150px;
            border-radius: 50%;
        }

        .box4 {
            position: absolute;
            left: 150px;
            top: 150px;
            border-radius: 50%;
        }

        .box5 {
            position: absolute;
            left: 150px;
            top: 300px;
            border-radius: 50%;
        }
    </style>
    <title>20190705作业,绝对定位小案例(</title>
</head>
<body>

    <div class="parent">
        <div class="box1"></div>
        <div class="box2"></div>
        <div class="box3"></div>
        <div class="box4"></div>
        <div class="box5"></div>
    </div>

</body>
</html>

运行实例 »

点击 "运行实例" 按钮查看在线实例

 

Correction status:qualified

Teacher's comments:下次把对应的作业标题写上, 以方便核对
Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post