圖解 CSS (3): padding(內邊距)、margin(外邊距)

來源:互聯網
上載者:User
paddingpadding-toppadding-rightpadding-bottompadding-leftmarginmargin-topmargin-rightmargin-bottommargin-left

padding: 上、右、下、左; {從上按順時針轉的}






可用 padding-top、padding-bottom、padding-left、padding-right 分別表示:


如果 padding 屬性缺失 right、bottom、left; 就都參考 top:


如果 padding 屬性缺失 bottom、left; bottom 會參考 top, left 會參考 right:


如果 padding 屬性缺失 left; left 會參考 right:


外邊距 margin 和內邊距 padding 道理是一樣的:


相關文章

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.