CSS盒模型中兩種模型的簡單介紹

來源:互聯網
上載者:User
本篇文章給大家帶來的內容是關於CSS盒模型中兩種模型的簡單介紹,有一定的參考價值,有需要的朋友可以參考一下,希望對你有所協助。

基本概念

盒模型是有兩種標準的,一個是標準模型,一個是IE模型。

標準模型中,盒模型的寬高只是內容(content)的寬高

IE模型中盒模型的寬高是內容(content)+填充(padding)+邊框(border)的總寬高

css如何設定兩種模型

     /* 標準模型 */     box-sizing:content-box;     /*IE模型*/     box-sizing:border-box;
相關文章

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.