2014-04-24 24 views
0

是否可以使用border屬性設置border-radius元素?如何使用border屬性設置邊界半徑

我想如下相同的結果:

#myelement { 
    border: 1px solid #535353; 
    border-radius: 5px 5px 5px 5px; 
} 

我要像下面的一些代碼(但下面的代碼不工作):

#myelement { 
    border: 1px solid #535353 5px 5px 5px 5px; 
} 

如果你知道答案,你會介意告訴你如何找到答案?我只是無法在谷歌:(

+1

我不認爲你可以做到這一點,是因爲'邊界radius'本身就是一個簡寫(用於' border-bottom-radius','border-right-radius','border-bottom-radius'和'border-left-radius')。我想它必須是分開的,因爲你不能把速記屬性放到另一個屬性中速記屬性('border'是一個速記屬性。) – Ming

回答

3

border屬性的語法是:

<br-width> || <br-style> || <color> 

和這些值的含義:

<br-width> 
The width of the border of the elements. Default value medium is used if absent 
<br-style> 
The line style for all four sides of the elements border. Default value none is used if absent 
<color> 
Denote the color of the border. If not set, its default value is the value of the element's color property (the text color, not the background color) 

所以它不可能包括border-radiusborder