2015-11-05 116 views
0

你可以幫我製作桌角嗎?我已經嘗試了簡單的border-radius,但是這只是將角落分開。這是由我的瀏覽器(Firefox)還是它的錯誤? Jsfiddle - http://jsfiddle.net/vuys8eef/圓桌角落

+1

你的問題可以在這裏得到解答[圓角表角落CSS只(http://stackoverflow.com/questions/4932181/rounded-table-corners-css單程-only) –

+0

[Rounded table corner CSS only]的可能重複(https://stackoverflow.com/questions/4932181/rounded-table-corners-css-only) –

回答

3

您需要圓你的表的第一個和最後一排也是第一個和最後一個欄的角落。

事情是這樣的:

table tr:first-child th:first-child { 
    border-top-left-radius:10px 
    } 


table tr:first-child th:last-child { 
    border-top-right-radius:10px 
} 

table tr:last-child td:first-child { 
    border-bottom-left-radius:10px 
} 

table tr:last-child td:last-child { 
    border-bottom-right-radius:10px 
} 

你可以看到你更新fiddle

+0

不需要「border-radius」的前綴。 –

+0

你是對的,這樣更清潔;) – morgul

+0

只是在找你,沒有人有時間做額外的工作xP –

1

您正在將它應用於錯誤的元素,請改用它。

td, th{ 
    border-radius: 5px; 
} 

CODEPEN DEMO

1

你好你的代碼是好的,但你可以使用overflow:hidden表上隱藏的內容裏面。這是要做到這一點:)

例如JSFIDDLE