移動端開發

來源:互聯網
上載者:User

標籤:flex   size   背景   不能   meta   dev   大小   解析度   tar   

  • viewport
    • <meta name="viewport" content="width=device-width,
      height=device-height,user-scale=no.initial-scale=1.0,
      minimun-scale=1.0,maximun-scale=1.0,target-densitydpi=device-dpi"/>

      • device-width/數值(大部分安卓手機不支援,蘋果手機支援)
      • height可以不設定,會根據寬度自動縮放。
      • dpi//ios不支援,安卓大部分支援。
    • 媒體查詢
      • @media
        • all  媒體類型
        • and() 連結作用
        • only 特定裝置
        • not 排除裝置
      • 媒體特性
        • (max-width:500px)
        • (min-width:300px)
        • (orientation:portrait)豎屏
        • (orientation:landscape)橫屏
        • (-webkit-min-device-pixel-ratio:2)像素比
  • 移動端適配方案
    • 版面設定固定寬度320px,margin置中,左右留白用背景填充
    • 通過media,根據不同解析度去設定不同的樣式
    • 通過,百分比,flex或者rem等手段,等比例縮放
    • rem
      • em相對於字型大小 font-size=16px  1em=16px;
      • ren相對於根節點html的字型大小  html字型大小為16px  1rem=16px;
    • 頭部和底部的固定不能用固定定位,會有相容問題,用絕對位置。

移動端開發

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.