1.WWW
What?
①.诞生于2011年,来自Twitter公司,是目前最受欢迎的前端框架
②.是一个用于快速开发Web应用程序和网站的前端框架
③.Bootstrap是基于HTML、CSS、JS的,简洁灵活,使得Web开发更加快捷
概述:Bootstrap是一个建立一个页面,就可以在三个终端(PC端、平板、手机)上完美展示的响应式前端框架
Why?
①.响应式设计(Bootstrap的响应式CSS能够自适应台式机、平板电脑和手机)
②.移动设备优先
③.浏览器支持
④.容易上手
Where?
企业网站、博客、网站后台之类的网站
电商(电商网站分类太多)
课程目标
实现网上书城部分界面布局
2. 环境安装
①.下载Bootstrap库
https://v4.bootcss.com/
②.页面中引入库
bootstrap.css:Bootstrap核心样式【添加到head标签中】
jquery-3.3.1.js:jQuery库【注意:必须在Bootstrap核心库引入之前引入jQuery库】
bootstrap.js:Bootstrap核心库
【添加到</body>之前】
案例
案例1:查询按钮原生态实现对比Bootstrap方式实现
<head>
<meta charset="utf-8">
<title>01案例:查询按钮原生态实现 与 Boostrap实现</title>
<!-- 1.引入Bootstrap的css依赖 -->
<link rel="stylesheet" type="text/css" href="css/bootstrap.css" />
<!-- 2.引入jQuery 类库 , 在 Bootstrap.js 之前 -->
<script src="./js/jquery-3.6.0.js" type="text/javascript" charset="utf-8" ></script>
<!-- 3.引入Bootstrap.js -->
<script src="js/bootstrap.js" type="text/javascript" charset="utf-8"></script>
<!-- 嵌入css -->
<style type="text/css">
/* 通过id选择器设置按钮样式 */
#btn{
/* 宽度 */
width:90px ;
height: 35px;
/* 去掉边框 */
border: 0px;
/* 背景 */
background-color: royalblue;
/* 颜色 */
color: white;
/* css3.0 设置圆弧*/
border-radius: 5px;
}
</style>
</head>
<body>
<h3>1.原生态实现查询按钮</h3>
<p>默认按钮</p>
<input type="button" value="查询" />
<a href="javascript:void(0)">查询</a>
<button>查询</button>
<br/><br />
<p>设置样式过后的按钮</p>
<button id="btn">查询</button>
<hr />
<h3>2.Bootstrap实现查询按钮</h3>
<button class="btn">查询</button>
<button class="btn btn-primary">查询</button>
<button class="btn btn-success">查询</button>
<button class="btn btn-warning">查询</button>
&l