• <tt id="xzngg"><form id="xzngg"><label id="xzngg"></label></form></tt>
    <b id="xzngg"></b>

    <cite id="xzngg"><span id="xzngg"><samp id="xzngg"></samp></span></cite>
      <cite id="xzngg"><form id="xzngg"><samp id="xzngg"></samp></form></cite>
    1. <tt id="xzngg"><form id="xzngg"><label id="xzngg"></label></form></tt>
        <rt id="xzngg"><meter id="xzngg"></meter></rt>
    2. <cite id="xzngg"></cite>

      服務熱線/微信:15002687135 QQ咨詢:767172404 歡迎光臨蘭州迅豹網絡信息科技有限公司官網!

      PC端、移動端、平板的適應CSS寫法

      發布時間:2023-11-24 15:00:18 人氣: 來源:網絡

      多套CSS

      1. 1200px 或以上被視為筆記本電腦和臺式機尺寸。

      2. 768px 到 1024px 被認為是平板尺寸。

      3. 767px 或以下被視為移動設備尺寸。

      /* 當頁面寬度大于767px小于1024px */

      PC端

                  body{

                      background:yellow;

                  }

       @media screen and (min-width:767px) and (max-width:1024px){

                  body{

                      background:yellow;

                  }

         }//平板

      @media screen and (max-width:767px) {

                  body{

                      background:yellow;

                  }

      }//移動端

      @media screen and (max-width:750px) {

                  body{

                      background:yellow;

                  }

      }//移動端

      @media screen and (max-width:480px) {

                  body{

                      background:yellow;

                  }

      }//移動端

      //移動端最后三個都是可以的,主要看你自己怎么寫

      css使用rem自適應

      css設置html的fontsize 

      html{

      font-size:1/19.2vw//0.052083333333333336vw;;

      }

      在頁面的元素全都按照設計圖px寫rem 如下

      .contAIner {

          position: relative;

          display: flex;

          flex-wrap: nowrap;

          width: calc(100% - 32rem);

          height: calc(100% - 32rem);

          margin: auto;

          // padding: 0 16rem;

          .lefWrap {

            display: flex;

            flex-direction: column;

            justify-content: space-between;

            width: 410rem;

            height: 100%;

          }

          .centerWrap {

            display: flex;

            flex: 1;

            flex-direction: column;

            justify-content: space-between;

            // position: relative;

            // width: 54%;

            max-width: calc(100% - 820rem);

            height: 100%;

            // margin: auto;

            padding: 0 16rem;

            /*  .boerddd {

              width: 13rem;

              height: 13rem;

              background: radial-gradient(rgba(97, 142, 255, 0.3) 25%, rgba(97, 142, 255, 0.6) 75%);

              // background-color: rgba(97, 142, 255, 0.6);

              border: solid 1rem rgba(97, 142, 255, 1);

              transform: rotate(45deg);

            } */

          }

          .rightWrap {

            // padding-bottom: 14rem;

            display: flex;

            flex-direction: column;

            justify-content: space-between;

            width: 410rem;

            height: 100%;

          }

      }


      最新網站案例
      • 蘭州網站建設
      • 蘭州網絡推廣
      • 蘭州網絡公司
      • 蘭州企業網站建設
      在線客服
      聯系方式

      熱線電話

      15002687135

      上班時間

      周一到周五

      公司電話

      17794277054

      二維碼
      蘭州企業官網建設
      日韩人妻Aⅴ按摩在线