• Bootstrap 3 媒体查询


    可以参考 Bootstrap  的媒体查询,写网站。

    html:

    <div class="bootstrap-3-media">
      <p>Mobile-First-Method</p>
      <div class="Mobile-First-Method">
    
        <div class="px320"><pre>/* Custom, iPhone Retina */ @media only screen and (min-width : 320px) { }</pre></div>
        <div class="px480"><pre>/* Extra Small Devices, Phones */ @media only screen and (min-width : 480px) { }</pre></div>
        <div class="px768"><pre>/* Small Devices, Tablets */ @media only screen and (min-width : 768px) { }</pre></div>
        <div class="px992"><pre>/* Medium Devices, Desktops */ @media only screen and (min-width : 992px) { }</pre></div>
        <div class="px1200"><pre>/* Large Devices, Wide Screens */ @media only screen and (min-width : 1200px) { }</pre></div>
    
      </div>
      <p>Non-Mobile-First-Method</p>
      <div class="Non-Mobile-First-Method">
    
        <div class="px320"><pre>/* Custom, iPhone Retina */ @media only screen and (min-width : 320px) { }</pre></div>
        <div class="px480"><pre>/* Extra Small Devices, Phones */ @media only screen and (min-width : 480px) { }</pre></div>
        <div class="px768"><pre>/* Small Devices, Tablets */ @media only screen and (min-width : 768px) { }</pre></div>
        <div class="px992"><pre>/* Medium Devices, Desktops */ @media only screen and (min-width : 992px) { }</pre></div>
        <div class="px1200"><pre>/* Large Devices, Wide Screens */ @media only screen and (min-width : 1200px) { }</pre></div>
    
      </div>
    </div>

    css:

    // https://scotch.io/tutorials/default-sizes-for-twitter-bootstraps-media-queries
    
    .px320,
    .px480,
    .px768,
    .px992,
    .px1200{
      display: none;
    }
    
    /*==================================================
    =            Bootstrap 3 Media Queries             =
    ==================================================*/
    
        // /*==========  Mobile First Method  ==========*/
    
        /* Custom, iPhone Retina */
        @media only screen and (min-width : 320px) {
          .Mobile-First-Method .px320{
            display: block;
          }
        }
    
        /* Extra Small Devices, Phones */
        @media only screen and (min-width : 480px) {
          .Mobile-First-Method .px480{
            display: block;
          }
        }
    
        /* Small Devices, Tablets */
        @media only screen and (min-width : 768px) {
          .Mobile-First-Method .px768{
            display: block;
          }
        }
    
        /* Medium Devices, Desktops */
        @media only screen and (min-width : 992px) {
          .Mobile-First-Method .px992{
            display: block;
          }
        }
    
        /* Large Devices, Wide Screens */
        @media only screen and (min-width : 1200px) {
          .Mobile-First-Method .px1200{
            display: block;
          }
        }
    
        /*==========  Non-Mobile First Method  ==========*/
    
        /* Large Devices, Wide Screens */
        @media only screen and (max-width : 1200px) {
          .Non-Mobile-First-Method .px320{
            display: block;
          }
        }
    
        /* Medium Devices, Desktops */
        @media only screen and (max-width : 992px) {
          .Non-Mobile-First-Method .px480{
            display: block;
          }
        }
    
        /* Small Devices, Tablets */
        @media only screen and (max-width : 768px) {
          .Non-Mobile-First-Method .px768{
            display: block;
          }
        }
    
        /* Extra Small Devices, Phones */
        @media only screen and (max-width : 480px) {
          .Non-Mobile-First-Method .px992{
            display: block;
          }
        }
    
        /* Custom, iPhone Retina */
        @media only screen and (max-width : 320px) {
          .Non-Mobile-First-Method .px1200{
            display: block;
          }
        }
  • 相关阅读:
    [计算机故障处理]小区宽带无法上网(中国联通)
    [计算机故障]笔记本无法启动,开机启动出现“Operating System Not Found”无法进系统
    [英语学习]微软面试前英语集训笔记-day 1
    [办公应用]如何将excel合并单元格分拆后每个单元格上仍保留数据?
    [办公应用]如何设置IE打印时的默认页边距,并设置纸张为横向(会计票据打印)
    [计算机故障]excel无法存盘,总是自动重启恢复
    codeforces732D 二分加贪心。。
    topcoder-srm701-div2-900 博弈计算二进制位1的个数dp状态压缩
    什么是超级立方体,HyperCube
    从维度理解dp问题
  • 原文地址:https://www.cnblogs.com/daysme/p/8151352.html
Copyright © 2020-2023  润新知