當(dāng)前位置:軟件學(xué)堂 > 資訊首頁 > 網(wǎng)絡(luò)編程 > DIV+CSS > css margin-left左側(cè)邊界屬性

css margin-left左側(cè)邊界屬性

2012/11/26 19:09:48作者:佚名來源:網(wǎng)絡(luò)

移動(dòng)端

【實(shí)例介紹】

css margin-left左側(cè)邊界屬性

margin-left屬性設(shè)置元素的左外邊距。

【基本語法】

margin-left:length

【語法介紹】

檢索或設(shè)置對(duì)象左邊的外延邊距。

【實(shí)例代碼】

<html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>無標(biāo)題文檔</title> <style type="text/css"> p.leftmargin {margin-left: 2cm} </style> </head> <body> <p>這個(gè)段落沒有指定外邊距。</p> <p class="leftmargin">這個(gè)段落帶有指定的左外邊距。</p> </body> </html>

【代碼分析】

在代碼中,加粗部分的標(biāo)記是設(shè)置左外邊距,在瀏覽器中預(yù)覽,效果如圖所示。

左側(cè)邊界屬性margin-left運(yùn)行效果

【素材及源碼下載】

請(qǐng)點(diǎn)擊:左側(cè)邊界屬性css margin-left 下載本實(shí)例相關(guān)素材及源碼

 

標(biāo)簽: css margin-left  左側(cè)邊界  屬性