zoukankan      html  css  js  c++  java
  • Bootstrap: 栅格系统

    bootstrap的栅格系统会将整个页面水平方向上平均分成12个小格子

    当浏览器大小发生变化的时候,我们可以控制每行的元素占用几个格子,从而达到响应式的效果

    显示屏幕的扩大和缩小. 实现如下效果

    <style>
        .a{
            height: 50px;
            border: 1px solid black;
            background-color: #eeeeee;
        }
    </style>
    <body>
        <div class="container">
            <div class="row">
                <!-- col-lg-3 当大屏幕时,一个div占3份,一行显示4个div -->
                <!-- col-md-4 当中屏幕时,一个div占4份,一行显示3个div -->
                <!-- col-sm-6 当小屏幕时,一个div占6份,一行显示2个div -->
                <!-- 超小屏幕时,一个div占12份,一行显示1个div,默认 -->
                <div class="col-lg-3 col-md-4 col-sm-6 a">x</div>
                <div class="col-lg-3 col-md-4 col-sm-6 a">x</div>
                <div class="col-lg-3 col-md-4 col-sm-6 a">x</div>
                <div class="col-lg-3 col-md-4 col-sm-6 a">x</div>
                <div class="col-lg-3 col-md-4 col-sm-6 a">x</div>
                <div class="col-lg-3 col-md-4 col-sm-6 a">x</div>
                <div class="col-lg-3 col-md-4 col-sm-6 a">x</div>
                <div class="col-lg-3 col-md-4 col-sm-6 a">x</div>
                <div class="col-lg-3 col-md-4 col-sm-6 a">x</div>
                <div class="col-lg-3 col-md-4 col-sm-6 a">x</div>
                <div class="col-lg-3 col-md-4 col-sm-6 a">x</div>
                <div class="col-lg-3 col-md-4 col-sm-6 a">x</div>
            </div>
        </div>
    </body>
        
  • 相关阅读:
    180. Consecutive Numbers
    181. Employees Earning More Than Their Managers
    15. 3Sum
    11. Container With Most Water
    178. Rank Scores
    在多台服务器上简单实现Redis的数据主从复制
    Head First
    23种设计模式(6):模版方法模式
    《Head.First设计模式》的学习笔记(9)--外观模式
    Head First--设计模式(装饰者模式)
  • 原文地址:https://www.cnblogs.com/JasperZhao/p/15249839.html
Copyright © 2011-2022 走看看