css最简单响应式布局

css布局(flex)

先来张效果图
在这里插入图片描述

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>display-flex</title>
    <style>
        *{
            margin: 0;
            padding: 0;
        }
        .flex-container{
            max-width: 960px;
            margin: 100px auto;
            display:flex;
            flex-wrap: wrap;
        }
        .one{ background: pink; }
        .two{ background: lightgreen; }
        .three{ background: skyblue; }
        .box{
            height: 100px;
            min-width: 300px;
            flex-grow: 1;
        }

    </style>
</head>
<body>
<div class="flex-container">
    <div class="box one"></div>
    <div class="box two"></div>
    <div class="box three"></div>
</div>
</body>
</html>

猜你喜欢

转载自blog.csdn.net/woochon/article/details/86537683