Bootstrap 是最受欢迎的 HTML、CSS 和 JS 框架,用于开发响应式布局、移动设备优先的 WEB 项目。

因为Bootstrap需要jquery的支持,所以在使用Bootstrap之前要先把jquery插件导入,并且要把bootstrap.js文件放在jquery.js之后改动方可生效。
Bootstrap中有许多好用的组件,只要以规定的class等命名就可以轻松使用这些插件。例如:
导航条:
<nav class="navbar navbar-default">
<div class="container-fluid">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" >Brand</a>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
<li class="active"><a href="#" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" >Link <span class="sr-only">(current)</span></a></li>
<li><a href="#" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" >Link</a></li>
<li class="dropdown">
<a href="#" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Dropdown <span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="#" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" >Action</a></li>
<li><a href="#" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" >Another action</a></li>
<li><a href="#" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" >Something else here</a></li>
<li role="separator" class="divider"></li>
<li><a href="#" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" >Separated link</a></li>
<li role="separator" class="divider"></li>
<li><a href="#" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" >One more separated link</a></li>
</ul>
</li>
</ul>
<form class="navbar-form navbar-left">
<div class="form-group">
<input type="text" class="form-control" placeholder="Search">
</div>
<button type="submit" class="btn btn-default">Submit</button>
</form>
<ul class="nav navbar-nav navbar-right">
<li><a href="#" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" >Link</a></li>
<li class="dropdown">
<a href="#" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Dropdown <span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="#" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" >Action</a></li>
<li><a href="#" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" >Another action</a></li>
<li><a href="#" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" >Something else here</a></li>
<li role="separator" class="divider"></li>
<li><a href="#" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" >Separated link</a></li>
</ul>
</li>
</ul>
</div><!-- /.navbar-collapse -->
</div><!-- /.container-fluid -->
</nav>
以上述的格式写出需要的代码就可以获得以下样式的导航条:
注:在上述代码中form表单即serch和submit部位,带有class="dropdown"的就是下拉菜单的区域,class="dropdown-menu"的就是下拉菜单的内容区,这些部分并非主要内容,可以删除。通过class="navbar-right/left/"可以设置该部位的导航条在总区域的左侧还是右侧。
栅格系统:
栅格系统是bootstrap中最为重要的部分,它通过
<div class="row"> <div class="col-md-1">.col-md-1</div> <div class="col-md-1">.col-md-1</div> <div class="col-md-1">.col-md-1</div> <div class="col-md-1">.col-md-1</div> <div class="col-md-1">.col-md-1</div> <div class="col-md-1">.col-md-1</div> <div class="col-md-1">.col-md-1</div> <div class="col-md-1">.col-md-1</div> <div class="col-md-1">.col-md-1</div> <div class="col-md-1">.col-md-1</div> <div class="col-md-1">.col-md-1</div> <div class="col-md-1">.col-md-1</div> </div> <div class="row"> <div class="col-md-8">.col-md-8</div> <div class="col-md-4">.col-md-4</div> </div> <div class="row"> <div class="col-md-4">.col-md-4</div> <div class="col-md-4">.col-md-4</div> <div class="col-md-4">.col-md-4</div> </div> <div class="row"> <div class="col-md-6">.col-md-6</div> <div class="col-md-6">.col-md-6</div> </div>
这样的形式来实现网页布局,只要调节class="col-md-6"就可以轻松改变单元格区域的排布,
如图:
注:
如上表:由于bootstrap是移动优先的,所以在判定时先从小屏开始,如col-xs-6指的是从width=768开始直到最大都是占6个单位的空间。
以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持。
# bootstrap栅格布局
# bootstrap常用组件
# bootstrap栅格化布局
# bootstrap栅格系统示例代码分享
# Bootstrap栅格系统使用方法及页面调整变形的解决方法
# Bootstrap栅格系统简单实现代码
# Boostrap中栅格布局的实现
# 基于BootStrap栅格栏系统完成网站底部版权信息区
# bootstrap学习使用(导航条、下拉菜单、轮播、栅格布局等)
# Bootstrap栅格系统学习笔记
# BootStrap栅格之间留空隙的解决方法
# 就可以
# 导航条
# 都是
# 放在
# 中有
# 要把
# 如图
# 主要内容
# 要先
# 要以
# 好用
# 指的是
# 表单
# 来实现
# 最受欢迎
# 大家多多
# 单元格
# 在上述
# button
# header
相关文章:
网站设计制作公司地址,网站建设比较好的公司都有哪些?
如何处理“XML格式不正确”错误 常见XML well-formed问题解决方法
建站之星展会模板:智能建站与自助搭建高效解决方案
网站制作中优化长尾关键字挖掘的技巧,建一个视频网站需要多少钱?
建站之星官网登录失败?如何快速解决?
山东云建站价格为何差异显著?
如何在橙子建站中快速调整背景颜色?
高端网站建设与定制开发一站式解决方案 中企动力
安云自助建站系统如何快速提升SEO排名?
道歉网站制作流程,世纪佳缘致歉小吴事件,相亲网站身份信息伪造该如何稽查?
如何高效配置香港服务器实现快速建站?
建站主机选购指南:核心配置与性价比推荐解析
电影网站制作价格表,那些提供免费电影的网站,他们是怎么盈利的?
微信推文制作网站有哪些,怎么做微信推文,急?
如何高效生成建站之星成品网站源码?
制作网站的过程怎么写,用凡科建站如何制作自己的网站?
常州自助建站:操作简便模板丰富,企业个人快速搭建网站
网站图片在线制作软件,怎么在图片上做链接?
制作网页的网站有哪些,电脑上怎么做网页?
h5在线制作网站电脑版下载,h5网页制作软件?
贸易公司网站制作流程,出口贸易网站设计怎么做?
C++如何编写函数模板?(泛型编程入门)
上海网站制作网页,上海本地的生活网站有哪些?最好包括生活的各个方面的?
宝盒自助建站智能生成技巧:SEO优化与关键词设置指南
利用JavaScript实现拖拽改变元素大小
如何高效利用200m空间完成建站?
品牌网站制作公司有哪些,买正品品牌一般去哪个网站买?
红河网站制作公司,红河事业单位身份证如何上传?
婚礼视频制作网站,学习*后期制作的网站有哪些?
英语简历制作免费网站推荐,如何将简历翻译成英文?
c++怎么实现高并发下的无锁队列_c++ std::atomic原子变量与CAS操作【详解】
如何快速搭建高效简练网站?
香港服务器部署网站为何提示未备案?
如何在建站宝盒中设置产品搜索功能?
南平网站制作公司,2025年南平市事业单位报名时间?
制作证书网站有哪些,全国城建培训中心证书查询官网?
网站制作哪家好,cc、.co、.cm哪个域名更适合做网站?
如何通过wdcp面板快速创建网站?
动图在线制作网站有哪些,滑动动图图集怎么做?
如何用西部建站助手快速创建专业网站?
魔毅自助建站系统:模板定制与SEO优化一键生成指南
建站主机与服务器功能差异如何区分?
如何选择PHP开源工具快速搭建网站?
建站上市公司网站建设方案与SEO优化服务定制指南
建站之星如何助力企业快速打造五合一网站?
如何在宝塔面板中修改默认建站目录?
电视网站制作tvbox接口,云海电视怎样自定义添加电视源?
如何通过商城自助建站源码实现零基础高效建站?
如何彻底卸载建站之星软件?
如何在腾讯云服务器快速搭建个人网站?
*请认真填写需求信息,我们会在24小时内与您取得联系。