移动端布局之流式布局

<!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>
        * {
            margin: 0;
            padding: 0;
        }
        
        section {
            width: 100%;
            margin: 0 auto;
            max-width: 800px;
            min-width: 500px;
        }
        
        section div {
            float: left;
            width: 50%;
            height: 300px;
        }
        
        section div:nth-child(1) {
            background-color: pink;
        }
        
        section div:nth-child(2) {
            background-color: blue;
        }
    </style>
</head>

<body>
    <section>
        <div></div>
        <div></div>
    </section>
</body>

</html>

在这里插入图片描述
在这里插入图片描述

发布了68 篇原创文章 · 获赞 1 · 访问量 1006

猜你喜欢

转载自blog.csdn.net/weixin_42378409/article/details/105143687
今日推荐