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:

  1. .curved {
  2. -moz-border-radius:10px;
  3. -webkit-border-radius:10px;
  4. behavior:url(border-radius.htc);
  5. }

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 🙂

Remiz

Remixed version of unstable human emotions and thirst of mankind actions. UX designer, UI developer and HE of WebCastle Media Pvt LTD

You may also like...

750 Responses

  1. Edygar says:

    Really nice, indeed. But with me doesnt worked when I tryed wiih

  2. rk939 says:

    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

  3. Naen says:

    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

  4. Gordon Hickley says:

    Both links to the HTC download on this page give 404 – Not Found.

  5. MIke says:

    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?

  6. Nora says:

    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.

  7. Nora says:

    Any div this is applied to in IE8 disappears for me … literally. Weird.

  8. Bryan says:

    Has anyone found a solution for using the htc with placing a rounded corner div inside a another rounded corner div?

  9. satheesh k says:

    ya its really good thinking for htc i one more thanks

  10. Patric says:

    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!

  11. LM Kerpen says:

    HTC via CSS works in IE8 !?
    Holy **** – thanks so much! I really have to look out for some whitepapers …

  12. Peter says:

    Good work! But after update for IE8, it’s stopped working in IE6. Border is disappeared.

  13. Bittu says:

    @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..??

  14. dave says:

    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

  15. toyotabedzrock says:

    Could be put into a user-script for Opera?

  16. woodsy says:

    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?

  17. Justin Gray says:

    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.

  18. Justin says:

    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.

  19. Vels says:

    Good Work Rem,

    Have one doubt. When we use .htc file it will block by IE popup block, how to avoid,

    Thanks,
    Vels

    • Remiz says:

      @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

  1. August 28, 2009

    […] of any box, but it only works in FF, Chrome and Safari. To make it work in IE, you have to refer to this trick by Remiz. Related PostsAsk Google for Astronomical Unit, proton mass, planet or sun’s mass […]

Talk your view

Read previous post:
Template fixed !

Finally , I got a nice simple template for this blog.  Hopefully,  I'll be posting from tommorow :) . I...

Close