开发者

Is there any way to give an image round borders using CSS?

开发者 https://www.devze.com 2023-03-15 18:21 出处:网络
I have an image which is square 100px by 100px. Was wondering if there was any way for giving an image rounded borders using C开发者_StackOverflowSS?

I have an image which is square 100px by 100px.

Was wondering if there was any way for giving an image rounded borders using C开发者_StackOverflowSS?

Similar to the border-radius property:

-moz-border-radius: 15px;
border-radius: 15px;

I would prefer not to resort to Javascript.

Thanks.


-moz-border-radius: 15px; and -webkit-border-radius:15px; should work fine in a standards compliant browser. Another technique:

<div style="border: 0px solid; border-radius: 30px; -moz-border-radius: 30px; -khtm border-radius: 30px; -webkit-border-radius: 30px; width: 100px; height: 100px; background: url('img.jpg');">
0

精彩评论

暂无评论...
验证码 换一张
取 消