2012-04-19 55 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