2013-03-14 33 views

回答

4

嘗試這樣

#testdiv{ 
    border-left:1px solid; 

}

12
div{ 
    border-left:solid red 3px; 
    border-right:solid violet 4px; 
    border-top:solid blue 4px; 
    border-bottom:solid green 4px; 
    background:grey; 
    width:100px; height:50px 
} 

DEMO

9

如果要單獨設置4個方面使用:

border-width: top right bottom left; 
border-style: solid dotted inset double; 
border-color: #f00 #0f0 #00f #ff0; 
9

可以指定邊界分隔符伊利的所有邊界,例如:

#testdiv{ 
    border-left: 1px solid #000; 
    border-right: 2px solid #FF0; 
} 

你也可以指定邊框的外觀,並使用單獨的樣式爲上,右,下和左邊框。例如:

#testdiv{ 
    border: 1px #000; 
    border-style: none solid none solid; 
} 
1
#testDiv{ 
    /* set green border independently on each side */ 
    border-left: solid green 2px; 
    border-right: solid green 2px; 
    border-bottom: solid green 2px; 
    border-top: solid green 2px; 
}