CSS3 allows a purely CSS rounded corner, but at this point that is not a cross-browser solution.
you can read about that here: http://virtuelvis.com/arch
Main Topics
Browse All TopicsHi, is there any way to apply curved corners on to images (which have square corners) using CSS? The reason is that our site will allow users to upload images, so we can't enforce the corners in the images - but wondered if there was a way to do this using CSS, by masking the corners somehow?
Thanks in advance
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
CSS3 allows a purely CSS rounded corner, but at this point that is not a cross-browser solution.
you can read about that here: http://virtuelvis.com/arch
Rounded corners on block elements is one thing. Rounded corners on images is something completely different.
There are different techniques... but none are perfect, so the best solution depends on your context.
We need to know if your images must be displayed "inline" and we also need to know if the size of your images is constant.
The most reliable technique is to use some graphics library (like ImageMagick) to add the rounded corners to the image file.
You can do that when the image is uploaded. But that goes against content/presentation separation if you consider the rounded corners beeing part of the presentation and the image beeing part of the content.
Or you can do it when the image is requested, but that will use processing time for each request.
Another technique is to use absolute/relative positioning to position your round masks in the corners of the image. But that won't work on inline images... using an inline table should work though. Anyway, all that adds a lot of overhead.
If the size of the image is constant, you can use a round mask as image and your original image as background-image. That should work fine.
Note that CSS3 does not define rounded corners, but only defines border-radius Mozilla already has an equivalent (-moz-border-radius).
That does not mask your image, the radius is just applied to the border in the background leaving the image with square corners.
Check this out... http://pro.html.it/esempio
It's possible to do rounded corners in CSS with a bit of JavaScript. I've used this and it works wonderfully. It's a good alternative until CSS 3 comes around...
GoofyDawg
Hey GS:
'Another technique is to use absolute/relative positioning to position your round masks in the corners of the image. But that won't work on inline images...'
Why not?
<span class="image"><span class="corner1"></span><sp
Just hypothetically, you could add style akin to:
span.image {
position: relative; /*add position to the span while retaining it's position and size in the original flow*/
}
span.image .corner1{ /*Repeat this for the other corners, using top/left/bottom/right combo's*/
position: absolute;
top: 0;
left: 0;
}
Like I said, hypothetic, didn't test any of this, but it could work just fine :)
Martin, I have not test it either, but...
Theoretically, the top corners should align with the line-top and the bottom corners should align with the line-bottom.
Depending on the image's vertical alignment, some corners might end up at the correct location... but that's nothing to be sure of.
You get that behaviour in FF when you set a border on a link that contains an inline image:
The border is not around the image, but around the section of the line that contains the image.
The exact same thing should happen with a span.
Business Accounts
Answer for Membership
by: flow79Posted on 2005-07-11 at 04:36:40ID: 14411242
http://www.albin.net/CSS/r oundedCorn ers/ articles/c ustomcorne rs/ rounded_co rners_in_c ss/
http://www.alistapart.com/
http://kalsey.com/2003/07/