加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

bootstrap栅格系统

发布时间:2020-12-17 21:19:33 所属栏目:安全 来源:网络整理
导读:bootstrap的栅格系统用于通过row与column的组合来布局页面布局 row必须包含在 container 或 container-fluid 中 使用bootstrap要先引入bootstrap的css和js文件,jquery文件,bootstrap是基于jquery的框架,所以在引入bootstrap的js文件之前,需要先引入jquer

bootstrap的栅格系统用于通过row与column的组合来布局页面布局

row必须包含在 containercontainer-fluid

使用bootstrap要先引入bootstrap的css和js文件,jquery文件,bootstrap是基于jquery的框架,所以在引入bootstrap的js文件之前,需要先引入jquery文件

举个例子

实现下面的效果

?

?只需要给div加上bootstrap的class名就好了

每一行row分为12列col,根据需要来进行合适的分配,就可以实现想要的页面布局

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>栅格系统</title>
    <link rel="stylesheet" href="css/bootstrap.min.css">
</head>

<body>
    <div class="container">
        <div class="row">
            <div class="col-md-3" style="background: blue">1</div>
            <div class="col-md-6" style="background: red">1</div>
            <div class="col-md-3" style="background: blue">1</div>
        </div>
    </div>
    <script src="js/jquery-3.4.1.js"></script>
    <script src="js/bootstrap.min.js"></script>
</body>

</html>

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读