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 🙂
Really nice, indeed. But with me doesnt worked when I tryed wiih
I m having problem with downloading the file; the web shows
‘ Your client does not have permission to get URL /p/curved-corner/ from this server’.
is there another way to download this file
this css curve using only in firefox, in i6 browser it is dont accept , do u have any fix-hack for that. send me in case u find means…. thanks regars Naren
Both links to the HTC download on this page give 404 – Not Found.
@Gordon Hickley :
I am moving this blog to a new server. For the time being, some files/links/images may not appear properly. More over, I’ve hosted this project on Google code. Please find it here http://code.google.com/p/curved-corner/
I am also having the issue with it dropping embeded ‘s when I try to use it multiple times.
is there a fix for this?
I can only guess by all those successfully using this that they do not have a doctype applied. Only works without a doctype … yikes!
Still a nice effort though.
Any div this is applied to in IE8 disappears for me … literally. Weird.
Has anyone found a solution for using the htc with placing a rounded corner div inside a another rounded corner div?
ya its really good thinking for htc i one more thanks
Yes, this is great! But, as I can read and have tested myself this does not work with nested divs. Is there anyway to solve it? Would be so great!
Keep up the good work!
HTC via CSS works in IE8 !?
Holy **** – thanks so much! I really have to look out for some whitepapers …
Good work! But after update for IE8, it’s stopped working in IE6. Border is disappeared.
@Remiz: This was awesome.. saved a lot of time for me. But this is not working for nested divs. 🙁
There are many ppl talking about nested divs earlier but no solution by any… Actually for nested divs this works fine with FF but not with IE… the inner div does not appear… any solutions for this..??
Worked a treat. I’m using Rackspace cloud who’s Cpanel doesn’t cater for mime type changes, so instead I created a .htaccess file with the following single line in it and dumped it in the root folder:
AddType text/x-component htc
hope this helps anyone with similar probs.
cheers,
Dave
Could be put into a user-script for Opera?
Am I the only one that’s having trouble with IE7 & IE8 hover effects with this script? It works flawlessly in Firefox, but unfortunately any DIV that this script is applied to seems to lose the ability to have a :hover style.
Any thoughts?
I just found the border-radius-ie8.htc file but it makes the border disapear completly.
Email me if you want to view the page as an example, I will upload it then.
This is a great script!
Unfortunately IE8 seems to act weird. It will make my tables width 100% of the windows width, but if I remove this script, the width is fine without rounded corners. Any way to fix this?
Opera c9.64 it does not wok at all. I tested this on Safari, Opera, Internet Explore 8, Firefox and Google Chrome. Only issues are the ones I stated.
Good Work Rem,
Have one doubt. When we use .htc file it will block by IE popup block, how to avoid,
Thanks,
Vels
@Vels : Thanks dude,
That IE warning will come only when you open the html from local drive. Once the files are on server, it wont appear.
IE blocks scripts running on local files by default
~R