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

    same here, not working.
    demo files are fine, but when i add it to my css nothing happens
    i’ve tried building a simple example and it does work, but with existing page no way
    i’m testing it in local so i cannot post a link, i’ve tried changing file path (i know it shouldn’t be a solution but you never know 😀 ) and file name, still nothing
    i suspect it could be some jquery conflict though i’m not a js expert, gonna investigate further

    • Jared says:

      I haven’t tested, but the latest version appears to use the smallest value of the css settings:
      -moz-border-radius
      -webkit-border-radius
      -khtml-border-radius
      border-radius

      So if you don’t have all of them set, it will potentially read a 0, thus no border radius.

      • wonderer says:

        thanks for your suggestion, unluckily it didn’t fix anything
        gonna try some other methods

  2. hi,
    the demo is not working in IE8. So its not IE compatible although it tells it can in last update?

  3. Roy Vincent says:

    background disappear in IE 6 to 8

  4. Dinesh says:

    with dis htc file how can i make the border only for bottomright and bottomrleft for my div..
    Is it possible if so, pls send to soruce code with new htc file

  5. Patrick says:

    Why not just simply round for DIVs?
    I tried this in a modified variant and doesn’t work in IE 🙁
    All I did was to give up the external file

  6. Jake says:

    I wonder where the download link is 😉

  7. taz says:

    It’s not workinng in IE8 and IE7 ;

    This is my css code

    #main { width:655px; overflow:hidden; margin:0 auto; background:#C3D92F; position:relative;
    -moz-box-shadow: 0px 0px 15px #000; /* Firefox */
    -webkit-box-shadow: 0px 0px 15px #000; /* Safari and Chrome */
    box-shadow:0px 0px 15px #000; /* Opera 10.5+, future browsers and IE6+ using IE-CSS3 */
    behavior: url(ie-css3.htc); /* This lets IE know to call the script on all elements which get the ‘box’ class */
    }
    .header { width:625px; margin:0 auto; padding:7px 0;}
    .logo { width:105px; float:left; overflow:hidden;}
    .titre { width:330px; float:right;}
    .page { background:#fff; padding:10px 0;}
    .contenue { width:490px; overflow:hidden; margin:0 auto; background:#F6F6F6; position:relative; padding:15px 50px ; text-align:left;
    border:1px solid #B7B7B5;
    -moz-border-radius:15px;
    -webkit-border-radius:15px;
    border-radius: 15px;
    behavior:url(border-radius.htc);
    }

  8. zthre says:

    does not work
    why?
    code:

    Biblia Tag

    body {
    background-color: #fff;
    font: normal 11pt Trebuchet MS,Arial,sans-serif;
    }
    .tag {
    width: 420px;
    height: 220px;
    margin: 0 auto 35px auto;
    padding: 30px;
    color: #fff;
    font-weight: bold;
    border: 11px solid #35b70e;

    -moz-border-radius: 32px;
    -webkit-border-radius: 32px;
    border-radius: 32px;
    behavior: url(border-radius.htc);
    }

    .rel {
    margin: 50px 0 0 33px;
    padding: 25px;
    position: relative;
    z-index: inherit;
    zoom: 1; /* For IE6 */
    }

  9. tracy says:

    anyone have any problems with the background not displaying 100% of the time on IE? I have a background image right now. will it help if i just turn it into a bg color only?

  10. Mike says:

    works fine, but background-repeat / background-position attributes just don’t work in internet explorer

  11. For my Limousine Paris Website, i used this script which worked perfectly.
    Thank you very much from a parisian chauffeur 😉

  12. chris says:

    Works great in ie8 but in ie7 I am getting a wierd extra 1 pixel of border… any idea why?

  13. Tulio says:

    please, is there any site i could upload for free this .htc?!
    or behavior:url(your_link_here_god_bless_you.htc);

  14. seattle seo says:

    I am experiencing mixed results with this “hack”. On some IE versions, the curved element will “flash” in it’s normal “box”/div form, and then the background goes bye-bye.

    I am using a bg image for the div…

    Any fixes?

  1. October 7, 2010

    […] donoszę, że skrypt, który miał pomóc Internet Explorerowi zaokrąglać rogi, jest mocno niedoskonały. Moim […]

  2. November 2, 2010

    […] am using border-radius.htc to fix border-radius in […]

  3. November 4, 2010

    […] corners for IE: It is possible to get this using Curvycorners JS script or the Remiz Rehnas’ Curved corners script. Or you can try using IE […]

  4. November 5, 2010

    […] LinkedIn […]

  5. November 12, 2010

    […] CSS curved-corner by Remiz: This is an another all browser compatible approach I found. This solution doesn’t need any additional corner images except that it requires a .htc file included if incase you wish to support IE browsers. Rest of it all comes in 2-3 lines of code. You can check out the google code base for a demo. […]

  6. November 14, 2010

    […] a venit cu o soluție foarte utilă. Remiz Rahnas a creat un fişier de HTC care este numit colţuri rotunjite (îl puteți descărca de pe Google […]

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