温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

bootstrap中怎么实现五列布局

发布时间:2021-07-26 11:38:05 来源:亿速云 阅读:159 作者:Leah 栏目:开发技术

bootstrap中怎么实现五列布局,很多新手对此不是很清楚,为了帮助大家解决这个难题,下面小编将为大家详细讲解,有这方面需求的人可以来学习下,希望你能有所收获。

我们知道,在使用Bootstrap栅格的时候,我们可以对网页方便的进行模块分割。Bootstrap 包含了一个响应式的、移动设备优先的、不固定的网格系统,可以随着设备或视口大小的增加而适当地扩展到12列。

它包含了用于简单的布局选项的预定义类,也包含了用于生成更多语义布局的功能强大的混合类。如果要2等分,使用col-md-6即可;要3等分,使用col-md-4即可;但如果我们要5等分或者8等分怎么办呢?下面的示例是bootstrap五等分布局:

<!DOCTYPE html><html>     <head>        <meta charset="UTF-8">        <!--视口的设置,让网页能等比例的缩放到对应设备中-->        <meta name="viewport" content="width=device-width, initial-scale=1.0" />        <!--告诉ie浏览器用最新内核去渲染网页-->        <meta http-equiv="X-UA-Compatible" content="ie=edge" />        <title>Document</title>        <link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css">         <style type="text/css">            .col-xs-1-5,            .col-sm-1-5,            .col-md-1-5,            .col-lg-1-5 {                position: relative;                min-height: 1px;                padding-right: 10px;                padding-left: 10px;            }                        .col-xs-1-5 {                width: 20%;                float: left;            }                        @media (min-width: 768px) {                .col-sm-1-5 {                    width: 20%;                    float: left;                }            }                        @media (min-width: 992px) {                .col-md-1-5 {                    width: 20%;                    float: left;                }            }                        @media (min-width: 1200px) {                .col-lg-1-5 {                    width: 20%;                    float: left;                }            }        </style>         <script src="https://cdn.staticfile.org/jquery/2.1.1/jquery.min.js"></script>        <script src="https://cache.yisu.com/upload/information/20201210/269/44422.jpg" />                             <div>                                <div id="">姓名:<span>王婷</span></div>                            </div>                             <div>                                <div id="">性别:<span>女</span></div>                            </div>                             <div>                                <div id="">部门:<span>宣传部</span></div>                            </div>                        </div>                    </div>                    <div>                        <div class="items text-center">                            <img src="../img/my.jpg" />                             <div>                                <div id="">姓名:<span>王婷</span></div>                            </div>                             <div>                                <div id="">性别:<span>女</span></div>                            </div>                             <div>                                <div id="">部门:<span>宣传部</span></div>                            </div>                        </div>                    </div>                    <div>                        <div class="items text-center">                            <img src="../img/my.jpg" />                             <div>                                <div id="">姓名:<span>王婷</span></div>                            </div>                             <div>                                <div id="">性别:<span>女</span></div>                            </div>                             <div>                                <div id="">部门:<span>宣传部</span></div>                            </div>                        </div>                    </div>                    <div>                        <div class="items text-center">                            <img src="../img/my.jpg" />                             <div>                                <div id="">姓名:<span>王婷</span></div>                            </div>                             <div>                                <div id="">性别:<span>女</span></div>                            </div>                             <div>                                <div id="">部门:<span>宣传部</span></div>                            </div>                        </div>                    </div>                     <div>                        <div class="items text-center">                            <img src="../img/my.jpg" />                             <div>                                <div id="">姓名:<span>王婷</span></div>                            </div>                             <div>                                <div id="">性别:<span>女</span></div>                            </div>                             <div>                                <div id="">部门:<span>宣传部</span></div>                            </div>                        </div>                    </div>                </div>            </div>        </body> </html>

看完上述内容是否对您有帮助呢?如果还想对相关知识有进一步的了解或阅读更多相关文章,请关注亿速云行业资讯频道,感谢您对亿速云的支持。

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI