2012-04-19 56 views
0

enter image description here的CSS圓角圖像與邊框和一些填充

希望這一形象講的一切...!需要在html + css中做到這一點。注意:我想要圖像中的邊框。

+1

不,它不會說一切 - 你有什麼嘗試? – Widor 2012-04-19 07:53:48

+13

圓形和邊框很容易,但使桌子和地板成爲棘手的部分。 – JJJ 2012-04-19 07:54:43

+0

你真的想要桌子和地板的樣式爲CSS? :-O – Tobi 2012-04-19 07:58:18

回答

8

CSS:

#border { 
    border:3px dashed white; 
    border-radius:100px; 
    width:184px; 
    height:184px; 
    position:relative; 
    left:5px; 
    top:5px; 
} 

#image { 
    background-image:url(table.jpg); 
    width:200px; 
    height:200px; 
    border-radius:100px; 
}​ 

HTML:

<div id="image"> 
    <div id="border"></div> 
</div>​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​ 

調整寬度和高度根據需要。

演示:http://jsfiddle.net/yGcFx/

+1

+1不錯。它在html + css中喵? – 2012-04-19 08:03:16

+3

http://jsfiddle.net/yGcFx/2/現在確實如此。 – 2012-04-19 08:05:59

+0

@AnubhavSaini好吧,如果你添加一個像'#image:hover #border:在{content:url(meowww.wav)之前的規則; }'在某些瀏覽器中,您可以製作貓_meowww_;) – fcalderan 2012-04-19 08:06:45