Layout(CSS)

來源:互聯網
上載者:User

理解box

inner content width: border + padding + width(如果沒有margin在的情況下inner content超過outer container的時候,會sacrifice outter padding, 用overflow控制)

inner containner width: margin + border + padding + width(如果當有margin在的情況下inner containner超過outer container的時候,會sacrifice inner magrin, 用overflow控制)

 

 

verticle margin collapse:(當沒有任何padding或者border組織兩個element或者兩個div裡面各包含一個p的結構組織他們margin touch彼此,collapse margin,)

1:當有兩個同級element上下重合的時候選用兩個中最大的margin作為他們之間的margin,比如p{margin:10px;  margin-top:20px} 重合結果2個P之間空出20px的margin

------>

相關文章

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.