bootstrap栅格系统响应式

时间:2020-10-15 12:47:00 来源:互联网 热度: 作者: 佚名 字体:

<img width="244" height="132" title="image" style="margin: 0; display: inline; background-image: none" alt="image" src="https://img2020.cnblogs.com/blog/1747317/202010/1747317-20201015124642158-1203707403.png" border="0" class="img-responsive">

小于768的手机端:col-xs

大于768小于992的平板:col-sm

大于992小于1200:col-md

大于1200:col-lg

<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <title>我是中国人</title>

        <!-- 新 Bootstrap 核心 CSS 文件 -->
        <link href="css/bootstrap.min.css" rel="stylesheet">

        <!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
        <script src="js/bootstrap.min.js"></script>

        <script src="https://cdn.staticfile.org/popper.js/1.15.0/umd/popper.min.js"></script>

        <style>
            div[class|=col] {
                border: 1px solid;
            }
        </style>
    </head>
    <body>
        <div id="" class="container-fluid">
            <div id="" class="row">
                <div class="col-md-3 col-sm-4 col-xs-6">.col-md-1</div>
                <div class="col-md-3 col-sm-4 col-xs-6">.col-md-1</div>
                <div class="col-md-3 col-sm-4 col-xs-6">.col-md-1</div>
                <div class="col-md-3 col-sm-4 col-xs-6">.col-md-1</div>
                <div class="col-md-3 col-sm-4 col-xs-6">.col-md-1</div>
                <div class="col-md-3 col-sm-4 col-xs-6">.col-md-1</div>
            </div>
        </div>
    </body>
</html>
<img width="244" height="17" title="image" style="margin: 0; display: inline; background-image: none" alt="image" src="https://img2020.cnblogs.com/blog/1747317/202010/1747317-20201015124642921-1749237320.png" border="0" class="img-responsive"><img width="244" height="27" title="image" style="margin: 0; display: inline; background-image: none" alt="image" src="https://img2020.cnblogs.com/blog/1747317/202010/1747317-20201015124643627-509069679.png" border="0" class="img-responsive">