zoukankan      html  css  js  c++  java
  • 001 bootstrap的基本模板

    一.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(媒体查询),它会自动的获取用户浏览器的行为.当用户的浏览器发生变化的时候,就可以发生响应式的变化.

  • 相关阅读:
    jQuery(七) jQuery $(document).ready()和javaScript onload事件
    jQuery(六) jQuery修改class属性和CSS样式
    jQuery(五) jQuery操纵DOM元素属性 attr()和removeAtrr()方法使用详解
    jQuery(四) jQuery操作DOM元素
    jQuery(三) jQuery选择器
    jquery(二) jQuery选取和操作元素的特点
    jquery(一) DOM对象与jQuery对象的转换与区别
    fastclick插件使用 移动端点击延时问题
    移动端click事件300毫秒延时解决
    返回顶部
  • 原文地址:https://www.cnblogs.com/trekxu/p/8458680.html
Copyright © 2011-2022 走看看