bootstrap 响应式布局


<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <meta name="viewpot" content="width=device-width,initial-scale=1.0">

    <title>learn bootstrap</title>

    <link href="bootstrap/css/bootstrap.min.css" rel="stylesheet">
    <style>
        body{background:#000}
        @media(max-767px){body{background:#f00}}
    </style>

  </head>
  <body>
  <script src="jquery1.11.3/jquery-1.11.3.min.js"></script>
  <script src="bootstrap/js/bootstrap.js"></script>


  </body>
</html>

说明

  1. @media(max-767px){body{background:#f00}}的意思是,当页面宽度小于757px的时候,使用后面的样式
  2. @media(min-767px){body{background:#f00}}的意思是,当页面宽度大于767px的时候,使用后面的样式
  3. @media(max-767px) and (min-500px ){body{background:#f00}}的意思是,当页面的宽度在500-767之间的时候,使用括号中的样式
原文地址:https://www.cnblogs.com/yufenghou/p/4501992.html