Curved corner (border-radius) cross browser
Update 18 November , 2009: The htc file is updated by Nick F. Thanks man, you got time to check it out. Now supports FF, Chrome, Safari, IE6, IE7, IE8 (Os doesn’t matter).
This version of htc files can be found here and demo here
Update 17 August, 2009: This project is moved to Google Code. Please find the htc files on http://code.google.com/p/curved-corner. Links to htc file below will not work.
Update 16 July, 2009: htc file updated with support for IE8. Thanks to Kevin for coming up with a work-around. New htc file can be downloaded on border radius ie8.
Update 10 June, 2009: Some servers need to set MIME type for HTC to work this in IE6.
To do this, follow the steps.
1. Go to your cpanel and click the MIME Types link
2. Under MIME Type, add text/x-component
3. Under Extensions, add htc
4. Restart Apache Web server
As I’ve pledged, today I’m posting the Curved corner without any js stuff.
For firefox, you can set border-radius by prefixing “-moz” to the css property. And ofcource for webkit use “-webkit” . Now IE ?? .. As IE is not a good browser to work with css, we need to make it so. Here, you need to use a nice css hack. Some how I managed to have an htc file to make border-radius work in IE 🙂 . You can download it here. border-radius.htc .
The Demo
1 . I’ve just made: http://www.htmlremix.com/files/20080924-border-radius.zip
The CSS:
- .curved {
- -moz-border-radius:10px;
- -webkit-border-radius:10px;
- behavior:url(border-radius.htc);
- }
The HTML:
<div class="curved">Curvd div</div>
The explanation :
Do you really want an explanation for this simple 3 line css ?. I don’t think so. Ofcourse if you need, I can.
Browsers :
All browsers 🙂
Download
Many people failed to find a download link. So no one will miss it again now 🙂
i don’t know why, but if i have the css and the htc file in the root of my project it works great. but when i put them in the css folder it stops working in ie7
anyone had this problem?
hi… i used this cod on my aspx pages.. and not working in IE7 browser…????!!!! but i used on my html page and working no problem in IE7!!!!! and hide /*behavior: url(css/border-radius.htc);*/
line on aspx pages to working in IE7 without radius…
This script kills opacity/alpha in IE div objects…. any idea how this can be fixed? Also can this be implemented on individual corners instead of all corners?
Super sweet. Thank you. My buttons look fantastic!
i still cannot do it …I am poo!
sorry for being such a novice will give it a go! Tar x
I need step by step instructions to implement this ..can any one help
Brother,
This has no steps 🙂
add the style in ur style file. put that htc in the proper path. ( same folder as css if using same code above )
Add class “curved” for the dic which you want to make curved.
done 🙂
Doesn’t work on IE8 with a doctype. If I remove the doctype, it works. Please fix this.
Thanks a lot…. I fix the my Round Box IE6 issues…
(Y)
I spent all day today trying to solve a bug with jquery.corner.js in safari. Problem solved 5 minutes after reading this. It was a real facepalm moment.
Thanks for publishing this! Wish I had found this BEFORE I tried to use jquery. (When all you have is a hammer…)
Hi every one… have any solution in ??? “Curved corner (border-radius) cross browser” Not Working in Windows XP Sp2 – “ie6″…
This worked really well. Thanks!
great idea. thanks
awesome!! did “Marin October 21st, 2008 (#): ” ever finish the modified .htc make the border the same colour as the element?
Thank You very much… very easy to use… Cool Tutorial
thanks a lot, love google, love this htc
NICE work… Thank you very much…i like it…
By using -moz & -webkit in your CSS, wouldn’t it make it invalid CSS 2.1?
Has anyone been able to get this to work inside tables? I can get it to work fine on test pages with no tables, but where I have a hybrid site with primary layout in CSS, but subsections using tables, it doesn’t work.
Is it possible to refer to a div’s id and not to a class? How would I need to change the .htc file in such a case?