css教程:CSS邊距margin屬性的應用_CSS教程
教程Tag:暫無Tag,歡迎添加,賺取U幣!
The CSS margin properties define the space around elements.
CSS的邊距屬性定義元素四周的空間范圍
設置文字左邊距 Set the left margin of a text
This example demonstrates how to set the left margin of a text.
Examples 實例:
[ 可先修改部分代碼 再運行查看效果 ]
設置文字右邊距 Set the right margin of a text
This example demonstrates how to set the right margin of a text.
Examples 實例:
[ 可先修改部分代碼 再運行查看效果 ]
設置文字頂邊距 Set the top margin of a text
This example demonstrates how to set the top margin of a text.
Examples 實例:
[ 可先修改部分代碼 再運行查看效果 ]
設置底部邊距 Set the bottom margin of a text
This example demonstrates how to set the bottom margin of a text.
Examples 實例:
[ 可先修改部分代碼 再運行查看效果 ]
快速設置四邊邊距 All the margin properties in one declaration
This example demonstrates how to set a shorthand property for setting all of the margin properties in one declaration.
Examples 實例:
[ 可先修改部分代碼 再運行查看效果 ]
The CSS margin properties define the space around elements. It is possible to use negative values to overlap content. The top, right, bottom, and left margin can be changed independently using separate properties. A shorthand margin property can also be used to change all of the margins at once.
CSS邊距定義元素四周的空間范圍。它可讓內容重疊。也可用分離的屬性分別對上,下,左,右進行樣式改變。用margin屬性可以快速的設置所有邊距。
Note: Netscape and IE give the body tag a default margin of 8px. Opera does not! Instead, Opera applies a default padding of 8px, so if one wants to adjust the margin for an entire page and have it display correctly in Opera, the body padding must be set as well!
注重: 網景和IE默認給body標簽加上了8px的邊距。OPERA就沒有這樣的情況,相反的,OPERA有個默認的8px填充,所以要讓頁面在幾個不同主流瀏覽器上的效果都相同就需要將屬性設置妥當!
CSS的邊距屬性定義元素四周的空間范圍
設置文字左邊距 Set the left margin of a text
This example demonstrates how to set the left margin of a text.
Examples 實例:
代碼調試框 [www.zhaotila.cn]
[ 可先修改部分代碼 再運行查看效果 ]
設置文字右邊距 Set the right margin of a text
This example demonstrates how to set the right margin of a text.
Examples 實例:
代碼調試框 [www.zhaotila.cn]
[ 可先修改部分代碼 再運行查看效果 ]
設置文字頂邊距 Set the top margin of a text
This example demonstrates how to set the top margin of a text.
Examples 實例:
代碼調試框 [www.zhaotila.cn]
[ 可先修改部分代碼 再運行查看效果 ]
設置底部邊距 Set the bottom margin of a text
This example demonstrates how to set the bottom margin of a text.
Examples 實例:
代碼調試框 [www.zhaotila.cn]
[ 可先修改部分代碼 再運行查看效果 ]
快速設置四邊邊距 All the margin properties in one declaration
This example demonstrates how to set a shorthand property for setting all of the margin properties in one declaration.
Examples 實例:
代碼調試框 [www.zhaotila.cn]
[ 可先修改部分代碼 再運行查看效果 ]
The CSS margin properties define the space around elements. It is possible to use negative values to overlap content. The top, right, bottom, and left margin can be changed independently using separate properties. A shorthand margin property can also be used to change all of the margins at once.
CSS邊距定義元素四周的空間范圍。它可讓內容重疊。也可用分離的屬性分別對上,下,左,右進行樣式改變。用margin屬性可以快速的設置所有邊距。
Note: Netscape and IE give the body tag a default margin of 8px. Opera does not! Instead, Opera applies a default padding of 8px, so if one wants to adjust the margin for an entire page and have it display correctly in Opera, the body padding must be set as well!
注重: 網景和IE默認給body標簽加上了8px的邊距。OPERA就沒有這樣的情況,相反的,OPERA有個默認的8px填充,所以要讓頁面在幾個不同主流瀏覽器上的效果都相同就需要將屬性設置妥當!
相關CSS教程:
- 相關鏈接:
- 教程說明:
CSS教程-css教程:CSS邊距margin屬性的應用
。