移動端響應式的基礎設定

來源:互聯網
上載者:User

標籤:

這裡是基礎配置 藍色加粗加大綠色背景部分是最關鍵的,其他的都是輔助

 1 @charset "utf-8"; 2 html { 3     font-size: 625%; 4 } 5 body,h1,h2,h3,h4,p,ul,ol,form,fieldset,figure { 6     margin: 0; 7     padding: 0; 8 } 9 body {10     background-color: #fff;11     font-family: "Helvetica Neue", Helvetica, Arial, "Microsoft Yahei UI", "Microsoft YaHei", SimHei, "\5B8B\4F53", simsun, sans-serif;12     font-size: .16rem;13 }14 ul,ol {15     list-style: outside none none;16 }17 a {18     text-decoration: none;19 }20 img {21     display: block;22     max-width: 100%;23 }24 div,figure,figcaption {25     box-sizing: border-box;26 }27 .none {28     display: none;29 }30 .clearfix:after {31     content: ‘.‘;32     display: block;33     clear: both;34     height: 0;35     visibility: hidden;36 }

 以下是測試代碼

.45rem意思是45px

.16rem意思是16px 

如果需要設定響應式的1px 紅色 實線 邊框,可以這樣寫------border:solid  .01rem #f00;

註:rem是css3新的單位,是相對根項目的一種單位,詳情可以諮詢W3C

 

1 37 #header {2 38     width: 100%;3 39     height: .45rem;4 40     background-color: #333;5 41     font-size: 0.16rem;6 42     position: fixed;7 43     top: 0;8 44     z-index: 9999;9 45 }

 

移動端響應式的基礎設定

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.