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. John says:

    Many thanks for a very simple fix that works for me.

  2. Srihari says:

    Awesome fix. Worked excellent for me. Thanks a lot.

  3. dns says:

    i have been try to this one , lot of thanks for u and Good work

  4. Aji Prabowo says:

    good job!! haven’t tried it yet, but the tweak looks promising 🙂

    regards,
    aji

  5. Ritesh says:

    Doesn’t work on IE6 at all….

  6. Pete says:

    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.

  7. Shahul says:

    I download demo file and opened in IE8, But it won’t work.

    • Britt says:

      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.

    • Britt508 says:

      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.

  8. vivek says:

    Thanks…………!

  9. Tom says:

    It doesnt work when container div has an image for bacground.

    Thanks

  10. MS says:

    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?

  11. Volomike says:

    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.

  12. Pedro says:

    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

  13. Christer says:

    Hi,
    I appreciate your tutorial on border-radius property but can i make it work on mobile browsers too?

  14. Christer says:

    Hi,
    I really appreciate your tutorial but..
    How can I make the border-radius property work on mobile browsers.

  15. Michael says:

    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?

  16. 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

  17. bobbin says:

    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.

  18. wiki says:

    basically .htc is not stable so dont waste your time

  1. December 15, 2010

    […] Cur­ved cor­ner (border-radius) cross brow­ser | HTML Remix abge­run­dete Ecken im IE Tags: ie curve cur­ved bor­der abge­run­dete ecken […]

  2. January 25, 2011

    […] Quoted from: htmlremix.com […]

Talk your view

%d bloggers like this:
Read previous post:
Template fixed !

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

Close