BootStrap简介
Bootstrap是美国Twitter公司的设计师Mark Otto和Jacob Thornton合作基于HTML、CSS、JavaScript 开发的简洁、直观、强悍的前端开发框架,使得 Web 开发更加快捷。
?
Bootstrap 是一个用于快速开发 Web 应用程序和网站的前端框架。Bootstrap 是基于 HTML、CSS、JAVASCRIPT 的。
?
简单,直观,强悍的前端开发框架,让web开发更迅速
?
优点: 快速,简单,灵活的栅格系统,小而强大,响应式布局,跨平台等
?
为什么使用BootStrap?
![2]()
![]()
?
Bootstrap包的内容
-
基本结构:Bootstrap 提供了一个带有网格系统、链接样式、背景的基本结构。这将在 Bootstrap 基本结构 部分详细讲解。
-
CSS:Bootstrap 自带以下特性:全局的 CSS 设置、定义基本的 HTML 元素样式、可扩展的 class,以及一个先进的网格系统。这将在 Bootstrap CSS 部分详细讲解。
-
组件:Bootstrap 包含了十几个可重用的组件,用于创建图像、下拉菜单、导航、警告框、弹出框等等。这将在 布局组件 部分详细讲解。
-
JavaScript 插件: Bootstrap 包含了十几个自定义的 jQuery 插件。您可以直接包含所有的插件,也可以逐个包含这些插件
-
定制:您可以定制 Bootstrap 的组件、LESS 变量和 jQuery 插件来得到您自己的版本。
?
?
BootStrap环境安装
我们可以再下面地址下载bootstarp相应版本
bootstrap下载地址 https://github.com/twbs/bootstrap/releases/download/v3.3.7/bootstrap-3.3.7-dist.zip
使用文档 https://getbootstrap.com/docs/4.4/components/navbar/
?
国内可以使用CDN上的库
国际推荐使用:https://cdnjs.com/
?
文件结构
![]()
如上图所示,可以看到已编译的 CSS 和 JS(bootstrap.),以及已编译压缩的 CSS 和 JS(bootstrap.min.)。同时也包含了 Glyphicons 的字体,这是一个可选的 Bootstrap 主题。
?
?
Bootstrap使用
Example1
<!DOCTYPE html> <html lang="en"> <head> ? ?<meta charset="UTF-8"> ? ?<title>Title</title> ? ?<link type="text/css" href="../bootstrap.min.css" rel="stylesheet"> </head> <body> <a class="btn btn-primary" href="#" role="button">Button按钮</a> <button class="btn btn-success" type="submit">Button</button> <input class="btn btn-warning" type="button" value="Input"> </body> </html>
?
Example2
<!DOCTYPE html> <html lang="en"> <head> ? ?<meta charset="UTF-8"> ? ?<title>Title</title> ? ?<link rel="stylesheet" href="../static/bootstrap-3.3.7-dist/css/bootstrap.min.css"> </head> <body> <table border="1" class="table table-bordered table-hover table-striped"> ? ?<thead> ? ?<tr> ? ? ? ?<th>姓名</th> ? ? ? ?<th>年龄</th> ? ?</tr> ? ?</thead> ? ?<tbody> ? ?<tr> ? ? ? ?<td>幽梦</td> ? ? ? ?<td>18</td> ? ?</tr> ? ?<tr> ? ? ? ?<td>渐渐</td> ? ? ? ?<td>18</td> ? ?</tr> ? ?<tr> ? ? ? ?<td>无奈</td> ? ? ? ?<td>18</td> ? ?</tr> ? ?</tbody> </table> </body> </html>
?
?
Example3
<!DOCTYPE html> <html> <head lang="en"> ? ?<meta charset="UTF-8"> ? ?<title></title> ? ?<link type="text/css" rel="stylesheet" href="bootstrap.min.css"> ? ? ?<style> ? ? ? ?.row { ? ? ? ? ? ?margin-bottom: 20px; ? ? ? } ? ? ? ? ?.row .row { ? ? ? ? ? ?margin-top: 10px; ? ? ? ? ? ?margin-bottom: 0px; ? ? ? } ? ? ? ? [class*="col-"] { ? ? ? ? ? ?padding-top: 15px; ? ? ? ? ? ?padding-bottom: 15px; ? ? ? ? ? ?background-color: #eee; ? ? ? ? ? ?background-color: rgba(86,61,124,.15); ? ? ? ? ? ?border: 1px solid #dddddd; ? ? ? ? ? ?border: 1px solid rgba(86,.2); ? ? ? } ? ?</style> </head> <body> <nav class="navbar navbar-inverse navbar-fixed-top" role="navigation"> ? ?<div class="container"> ? ? ? ? (编辑:李大同)
【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!
|