16-2·100 css 手机模块浮动布局 float

 

  

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>demo 模板</title>
    <style>
        .box {
            width: 1226px;
            height: 615px;
            background-color: red;
            margin: 0 auto;
        }

        .left {
            float: left;
            width: 234px;
            height: 615px;
            background-color: blue;
        }

        .right {
            float: left;
            width: 992px;
            height: 615px;
            background-color: rgb(103, 139, 19);

        }

        /* 子代选择器 */
        .right>div {
            float: left;
            width: 234px;
            height: 300px;
            background-color: rgb(199, 230, 25);
            margin-left: 14px;
            margin-bottom: 14px;

        }
    </style>
</head>

<body>

    <div class="box">
        <div class="left">左青龙</div>
        <div class="right">
            <!--   div*8{$} 回车 快捷输入法-->

            <div>1</div>
            <div>2</div>
            <div>3</div>
            <div>4</div>
            <div>5</div>
            <div>6</div>
            <div>7</div>
            <div>8</div>
        </div>
    </div>

</body>

</html>

效果
    

 

  类似这种,往里面添加内容就行了

 

posted @ 2022-02-13 13:21  优敏行  阅读(46)  评论(0)    收藏  举报