CSS Margin 教程

來源:互聯網
上載者:User

css margin是用來定義div 等容器的外邊距的,它有四個屬性:margin-top ,margin-right ,margin-left ,margin-bottom 分別為上,下,左,右.

還有一個我們定義div置中就可以這樣寫 margin:0px auto;這樣你的容器就要在IE的中間了,好了我們來看看margin一個簡單的執行個體吧.

p.margin {margin: 2cm 4cm 3cm 4cm}

這個是設定上右下左的外邊框.

上面的也可以這樣來寫.

<style type="text/css">
p.topmargin {margin-top: 5cm}

p.topmargin {margin-left: 5cm}

p.topmargin {margin-right: 5cm}

p.topmargin {margin-bottom: 5cm}
</style>

好了就這麼簡單www.111cn.net/cssdiv/css.html

相關文章

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.