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 🙂
Many thanks for a very simple fix that works for me.
Awesome fix. Worked excellent for me. Thanks a lot.
i have been try to this one , lot of thanks for u and Good work
good job!! haven’t tried it yet, but the tweak looks promising 🙂
regards,
aji
Doesn’t work on IE6 at all….
Working great for me (with a z-index fix I found somewhere).
One question though. I have hidden content inside curved border area. In Firefox, the box resizes when hidden content is shown, but in IE, the bottom of the bordered area does not move, so the content expands below the curved border section when shown.
Any clues as to what might be doing this, or what I can try to resolve this?
Many thanks,
Pete.
I download demo file and opened in IE8, But it won’t work.
Works in IE – What I did was:
same for the ending for it.
However – I have a toggle event in this rounded bubble and when the text is clicked it doesn’t stay contained within the container.
Works in IE – What I did was:
same for the ending div for it.
However – I have a toggle event in this rounded bubble and when the text is clicked it doesn’t stay contained within the container.
Thanks…………!
It doesnt work when container div has an image for bacground.
Thanks
Any suggestions on how the .htc file can be modified to also support border-top-right-radius and border-top-left-radius, to create more specific effects like partially rounded boxes?
When I run this with IE8, my Apache 2.2 on Ubuntu 10.04 emits this:
Request exceeded the limit of 10 internal redirects due to probable configuration error. Use ‘LimitInternalRecursion’ to increase the limit if necessary. Use ‘LogLevel debug’ to get a backtrace.
If I comment out the CSS behavior line, the above error goes away. I even tried to explicitly call the full path of the .htc file and I get the same problem. Also, IE8 does not exhibit the proper behavior.
Hi,
I have a problem with this htc in ie8 (using windows vista). When the page loads the display is correct, but when I refresh it using F5… the display is different, not as expected. Same occur with the example in the .zip file
Hi,
I appreciate your tutorial on border-radius property but can i make it work on mobile browsers too?
Hi,
I really appreciate your tutorial but..
How can I make the border-radius property work on mobile browsers.
Well, I have another issue that I can’t seem to find a solution for. I can use the htc file and it rounds the border just fine, however, the underlying background’s corners are not rounded off to match the border. I’ve tested this on chrome and firefox and they work just fine. I don’t know what I’m doing wrong. I have to use in-line styling because where I need to use it doesn’t allow external java or other options. This is the code:
Words Go Here
Any ideas?
Hello,
Please link to the updated version:
http://code.google.com/p/curved-corner/issues/attachmentText?id=51&aid=3354459078227954812&name=rounded-corners.htc
That version was updated by Dennis Westphal in order to support CSS sprites. Today I lost 2 hours trying to figure out how to fix your script only to find out that a working version already exists (for sprites).
If you don’t have time to update your work with the latest changes just put the link in the article.
And btw: thank you for sharing this.
Regards,
Razvan
I will see and update it when I get some breath. Thank you for sharing
The way i got this to work was to have “behavior: url(border-radius.htc);” on the .htm page itself. Everything else was fine to be in the .css file. I made myself feel better about that by putting it in a conditional for IE.
basically .htc is not stable so dont waste your time