Blogger Information
Blog 45
fans 0
comment 1
visits 33017
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
响应式布局
源逸
Original
844 people have browsed it
  1. 栅格布局中的列,设置不同的参数,针对不同设备显示效果也不同

  2. col-[lg,md,sm,xs]-*  对不同的设备设置不同的效果,从而达到自适应的效果


  3. 实例

    <!DOCTYPE html>
    <html lang="zh-CN">
    <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <link rel="stylesheet" href="static/css/bootstrap.css">
        <title>响应式布局,适应多种屏幕尺寸(2019.05.24)</title>
        <style>
            .grid {
                border: 1px solid #696969;
                border-radius: 5px;
                /*background-color: wheat;*/
                min-height: 50px;
                text-align: center;
                line-height: 50px;
            }
        </style>
    </head>
    <body>
    
    <div class="container">
        <div class="row">
            <div class="col-lg-9 col-md-6 col-sm-7 col-xs-4 bg-info grid">左</div>
            <div class="col-lg-3 col-md-6 col-sm-5 col-xs-8 bg-success grid">右</div>
        </div>
    </div>
    
    
    <script src="static/js/jQuery-3.4.1.js"></script>
    <script src="static/js/bootstrap.js"></script>
    </body>
    </html>

    运行实例 »

    点击 "运行实例" 按钮查看在线实例

    QQ图片20190617185805.png
Correction status:Uncorrected

Teacher's comments:
Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post