2012-12-03 133 views

回答

2

使用圖像作爲background-image,和元素上應用border-radius

div 
{ 
    background-image:url('http://placehold.it/350x150'); 
    width:350px;height:150px; 
    border-radius:5px; 
}​ 

http://jsfiddle.net/mdNCm/1/


您可以使用border-radius.com生成跨瀏覽器CSS

+2

這是我第一次聽說邊界半徑,所以去Google找到了這個:http://border-radius.com/ –

+0

@PedroLamarão我每次使用該網站創建跨瀏覽器圓角邊框! – Curt

1

這是一個css3功能,尚未完全支持所有瀏覽器。進一步閱讀本文標籤:使用border-radius

border-radius: 25px; 
2

是的。

CSS:

div.rounded{ 
    border-radius: 5px; 
    border: 1px solid black; 
} 

HTML:

<div class="rounded">This text is in a rounded border!</div> 
+1

應該指出的是,並非所有的瀏覽器都支持這一點:http://caniuse.com/#feat=border-radius – Sean

0

您可以 邊界半徑實現這一目標:爲5px;

如果你想要一個角落的邊框,請使用這個。 Border-radius.com 它給你的代碼。

注:邊框半徑不符合某些瀏覽器如IE

工作,或者你可以使用一些圖片作爲CSS背景。