首页 > 试题广场 >

请使用 css 实现如图所示的布局样式。

[问答题]
请使用 css 实现如图所示的布局样式。

html:

<div class="box">

  <div class="column">

    <span class="item"></span>

    <span class="item"></span>

  </div>

  <div class="column">

    <span class="item"></span>

    <span class="item"></span>

  </div>

</div>


CSS:()


<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title></title>
    </head>
    <style type="text/css">
        .box{
            width: 100px;
            height: 100px;
            background-color: lightgray;
            border-radius: 10px;
            box-shadow: 0 0 3px 5px dimgray;
            display: flex;
            flex-direction: column;
            justify-content: space-around;
            align-content: space-between;
        }
        .column{
            display: flex;
            flex-direction: row;
            justify-content: space-around;
        }
        .item{
            width: 25px;
            height: 25px;
            background-color: black;
            border-radius: 50%;
            box-shadow: 0 0 2px 3px dimgray;
        }
    </style>
    <body>
        <div class="box">
            <div class="column">
                <span class="item"></span>
                <span class="item"></span>
            </div>
            <div class="column">
                <span class="item"></span>
                <span class="item"></span>
            </div>
        </div>
    </body>
</html>

发表于 2019-12-26 09:06:51 回复(0)
<!DOCTYPE html>
<html>
<head>
    <title></title>
    <style type="text/css">
        body{
            background-color: #000;
        }

        .box{
            width: 150px;
            height: 150px;
            padding: 10px;

            display: flex;
            flex-direction: row;
            justify-content: space-between;

            border-radius: 10px;

            background-color: #fff;
        }

        .box > .column{
            height: 100%;

            display: flex;
            flex-direction: column;
            justify-content: space-between;
        }

        .box > .column > .item{
            width: 50px;
            height: 50px;
            border-radius: 50px;

            background-color: #000;
        }
    </style>
</head>
<body>
    <div class="box">
      <div class="column">
        <span class="item"></span>
        <span class="item"></span>
      </div>
      <div class="column">
        <span class="item"></span>
        <span class="item"></span>
      </div>
    </div>
</body>
</html>
发表于 2019-12-22 13:40:51 回复(0)
<!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>
    <style>
        .box{
            width150px;
            height:150px;
            background:#ececec;
            margin:0 auto;
            border-radius:15px;
            display:flex;
            justify-content: space-around;
        }
        .column{
            height:200;
            width20px;
            display:flex;
            flex-direction:column;
            justify-content:space-around;
        }
        .column .item{
            width20px;
            height:20px;
            border-radius:100%;
            background:green;
        }
    </style>
</head>
<body>
<div class="box">
    <div class="column">
        <div class="item"></div>
        <div class="item"></div>
    </div>
    <div class="column">
        <div class="item"></div>
        <div class="item"></div>
    </div>
</div>
</body>
</html>
发表于 2019-12-12 08:18:45 回复(0)
<!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>
    <style>
    .box {
        width: 200px;
        height: 200px;
        border-radius: 10px;
        background-color: azure;
        display: flex;
        flex-direction: column;
        justify-content: space-around;
    }
    .box .column {
        display: flex;
        justify-content: space-around;
    }
    .box .item {
        width: 20px;
        height: 20px;
        border-radius: 50%;
        background-color: brown;
    }
    </style>
</head>
<body>
<div class="box">
    <div class="column">
        <div class="item"></div>
        <div class="item"></div>
    </div>
    <div class="column">
        <div class="item"></div>
        <div class="item"></div>
    </div>
</div>
</body>
</html>

发表于 2019-12-11 15:51:48 回复(0)
<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title></title>
        <style type="text/css">
            .box{
                width: 200px;
                height: 150px;
                background: black;
                
            }
            .innerbox{
                width: 80px;
                height: 80px;
                background: darkgray;
                position: relative;
                left: 60px;
                top: 30px;
                border-radius: 10px;
                
            }
            .item{
                width: 25px;
                height: 25px;
                background: black;
                border-radius: 12px;
                position: absolute;
            }
            .item:first-of-type{
                top:5px;
                left: 5px;
            }
            .item:nth-of-type(2){
                right: 5px;
                top: 5px;
            }
            .item:nth-of-type(3){
                bottom: 5px;
                left:5px
            }
            .item:nth-of-type(4){
                right: 5px;
                bottom:5px
            }
        </style>
    </head>
    <body>
        <div class="box">
            <div class="innerbox">
                <div class="item">
                    
                </div>
                <div class="item">
                    
                </div>
                <div class="item">
                    
                </div>
                <div class="item">
                    
                </div>
            </div>
        </div>
    </body>
</html>

发表于 2019-09-08 08:53:12 回复(0)