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. Filipe Silva says:

    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?

  2. mab says:

    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…

  3. Kevin says:

    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?

  4. Ellen says:

    Super sweet. Thank you. My buttons look fantastic!

  5. Jo says:

    i still cannot do it …I am poo!

  6. Jo says:

    sorry for being such a novice will give it a go! Tar x

  7. Jo says:

    I need step by step instructions to implement this ..can any one help

    • Remiz says:

      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 🙂

  8. Bugsy says:

    Doesn’t work on IE8 with a doctype. If I remove the doctype, it works. Please fix this.

  9. Daddy says:

    Thanks a lot…. I fix the my Round Box IE6 issues…

    (Y)

  10. Zach says:

    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…)

  11. Daddy says:

    Hi every one… have any solution in ??? “Curved corner (border-radius) cross browser” Not Working in Windows XP Sp2 – “ie6″…

  12. Annand says:

    This worked really well. Thanks!

  13. conor says:

    great idea. thanks

  14. Jon S says:

    awesome!! did “Marin October 21st, 2008 (#): ” ever finish the modified .htc make the border the same colour as the element?

  15. Vladorz says:

    Thank You very much… very easy to use… Cool Tutorial

  16. robin says:

    thanks a lot, love google, love this htc

  17. bince says:

    NICE work… Thank you very much…i like it…

  18. Julia says:

    By using -moz & -webkit in your CSS, wouldn’t it make it invalid CSS 2.1?

  19. Mark T says:

    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.

  20. Simon says:

    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?

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