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

    Thanx for this…

  2. joe says:

    Hi,
    I had used this technique previously on a client’s site and it worked.But now i am trying to use it on another site and it cant seem to work.The First site that’s working url is http://www.kifaruadventuresafaris.com/
    while the one that’s not is http://79.170.44.148/savagewildernesssafaris.com/index.php
    Here i want the drop down menu to have that rounded effect.
    Please help.Could it be because i’m using that SWmenupro Component?

  3. the SaNdMaN says:

    This script doesn’t seem to work if you include a different background color than white in the body.

  4. Christian says:

    Working pretty good but currently it is not applying well to TH (table head) elements. Any suggestions?

  5. Simon says:

    Everytime I use this .htc for adding border-radius in IE, it fucks up the whole background images of the element, its child elements and its first parent-node. They just get transparent.

    Me not like.

  6. XoverX says:

    This really saved me. I was using curvyCorners and it broke both my ads and my iframe shoutbox without reason and was hardly cross-compatible, not to mention the slow javascript loading (compressed too).

    Thank you so much! Works perfectly.

  7. shahzad says:

    Internet Explorer is a Fucking bitch.

  8. Nab says:

    Thanks for this tutorial. I just created my own for my blog and I’m very happy with the results. It was easy to follow and get working. I think many can do this change with ease.

  9. Sixtease says:

    Hmm, is there a way to parametrize the border radius?

  10. Sofia Muscaro says:

    I used to own a web-site just like yours, but then I stopped doing it. Definitely keep up the good work, you’re a great author!! 😀

  11. Rick says:

    Put this line between your tags. Solves some problems..

  12. filme online says:

    I was been looking the Google for this data and i wanted to thank you for the post. By the way, just off topic, how can i find a copy of this theme? – Thank you

  13. Stan says:

    This script kinda sucks if you’d want to use this on a real site and support hovers and nesting.

    hope you will keep improving this script!

  14. José says:

    The new updated example doesn’t work in IE8.

  15. kunderez says:

    …also if you alter content of the element after rounding it’s corners, auto-fit-contents will automatically fail… ( in IE )

  16. kunderez says:

    IE requests “none”-named resources if CSS background-image is set to “none”… so apply following fit to that htc-file…

    fill.src = fillSrc;// replace this line with following
    if( fillSrc != “none” ) fill.src = fillSrc;// fixed… ie wont request none-files

  17. SAM says:

    not works in IE8 🙁

  18. hasan says:

    this value –> 10px 10px 0px 0px
    not works in IE8

  1. October 2, 2010

    […] or rbg 0,0,0) and the border-radius cannot be applied to individual corners. Special thanks to Remiz Rahnas for building the original […]

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