一.bootstrap的基本模板
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<!-- 媒体查询,保证栅格系统的使用 这三个meta的标签必须放在最前面 -->
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Bootstrap的基本模板</title>
<!-- Bootstrap -->
<link href="bootstrap/css/bootstrap.css" rel="stylesheet">
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://cdn.bootcss.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<h1>你好,世界!</h1>
<button class="btn btn-primary">点击我</button>
<!-- bootstrap需要jquery的支持,因此首先引入jquery,否则出现问题 -->
<script src="bootstrap/js/jquery.js"></script>
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script src="bootstrap/js/bootstrap.min.js"></script>
</body>
</html>
二.注意点
[1]bootstap需要jquery的支持,因此在引入bootstap的支持的时候首先一定要引入jquery的支持.
[2]在模板最上面的meta标签一定不要进行修改,否则bootstap的响应式就会出现问题.
三.响应式的机理
在bootstrap之中,使用了meta(媒体查询),它会自动的获取用户浏览器的行为.当用户的浏览器发生变化的时候,就可以发生响应式的变化.