Border Radius for IE8

78,532

Solution 1

Try this:

requires:

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript" src="http://malsup.github.com/jquery.corner.js"></script>

Javascript:

$('.box').corner();

HTML:

<div class="box">Hello</div>

CSS:

box{
  width:150px;
  height:28px;
  padding:10px;
}

more examples: http://jquery.malsup.com/corner/

Solution 2

Short of using the libraries that you described in your question, I don't think you can do curved corners in IE8.

If you really wanted them, you could probably use an image to give the curved corner effect, at the cost of increased bandwidth and messy code.

Solution 3

According to Microsoft:

Other Rounded Corners Solutions

We would like to point out the abundance of alternate solutions available on the Web. In addition to individual rounded corners solutions, there are also sites with frequently updated lists of rounded corners solutions that are compatible with multiple versions of Internet Explorer and other browsers.

Listed here are a few of our favorite sites for aggregated rounded corners solutions. They are presented in no particular order, and the inclusion of any link does not imply endorsement by Microsoft of the site.

Solution 4

Check out this post: http://www.smashingmagazine.com/2010/04/28/css3-solutions-for-internet-explorer/

It covers specifically rounded corners and box shadow in IE7/8.

and also below with so many examples

http://blue-anvil.com/jquerycurvycorners/test.html

Solution 5

I have used the border-radius.htc in the past.

The only pain is that the CSS Urls are relative to the CSS file. HTC are relative to the page.

you can download the demo here.

Share:
78,532
BurebistaRuler
Author by

BurebistaRuler

Updated on February 27, 2020

Comments

  • BurebistaRuler
    BurebistaRuler about 4 years

    I have a problem with border radius on IE8, till now I used pie.js but I don't recommend this js library because is buggy. If you have a small site with not many html pages, it is more than ok to use that library, but if you have a heavy application in which many different frameworks are used, then is impossible to use that. Same behavior for CurvyCorners or other mega libraries.

    So if anyone can help me with a small jQuery or javascript plugin to do just border-radius on IE 8 I'll be grateful for life.

  • BurebistaRuler
    BurebistaRuler about 12 years
    try to do that on a form in which you have more that 150 inputs, selects, textaarea and other borders for which you want to add border radius. The result is: the page will open in few minutes. Because of that I need something easy like a jQuery,js function.
  • Tom Will
    Tom Will about 12 years
    That's true. From my experience, you're going to be stuck either having angular corners, or using a library which you already said was impossible.
  • BurebistaRuler
    BurebistaRuler about 12 years
    Yes, sow how we fix that on wonderful IE8? I like to think in this world is someone that resolved this.
  • Litek
    Litek about 12 years
    You don't fix it - every mentioned solution would be painfully slow when multiplied by 150 elements. So it's either images or nothing.
  • ShadowScripter
    ShadowScripter about 12 years
    @burebistaruler JQuery doesn't do good with lots of elements either, you know. JQuery is limited to the browser and its capabilities, while the pageload is done by the server, and the render by the browser. Consider having one image file with all the curved corners and do background-positioning. The client will only need to download the image once, and then it's cached in memory. It won't take a few minutes because you have one file.
  • BurebistaRuler
    BurebistaRuler about 12 years
    I cannot use .htc files on my project.
  • BurebistaRuler
    BurebistaRuler about 12 years
    Already tried this plugin ... it force you to have a background color.
  • BurebistaRuler
    BurebistaRuler about 12 years
    Hmmm I tried once with modernizr but know that something did not work. Do you have a small example with modernizr border-radius to test on IE8 to see how it works.
  • Ryan
    Ryan about 12 years
    After looking at the Modernizr fall-back I use and researching a little as a result of your comment, it will require images to be used on the corners - no longer cool, so this lead me to do a bit of research where I found this link that on my testing in IE8 as well as tested IE6, IE7 and IE8 browser modes in IE9 where it worked well. I hope this helps you a little more.
  • Tracker1
    Tracker1 about 12 years
    Either you need to use something that does .htc for the vector rendering, which is slow, as you mention for a lot of elements (like PIE), or you need to add additional elements for styling, this will require a background color, of some kind... it isn't magic and there is no quick fix, as you seem to be looking for.
  • yunzen
    yunzen about 12 years
    @burebistaruler I think you cannot expect him to do some graphics for rounded corners and then host them somewhere, just to help you with this
  • Niklas
    Niklas about 12 years
    Side note. Who'd want to fill out a form with more than 150 inputs?
  • BurebistaRuler
    BurebistaRuler about 12 years
    :))))) An intelligent client who wants a matrix page. I'm just the developer I cannot take decisions...
  • Houdmont
    Houdmont about 12 years
    That's not true, I believe you can use .corner(cc:xxx) to define the colour of the corner elements? (Where xxx is the colour you have chosen).
  • onof
    onof over 11 years
    This library works great. Thanks for solving my round corners nightmare
  • Rocco
    Rocco over 11 years
    This particular lib however adds tons of div containers around each form input in IE8 (I just counted 22 per input...wtf?). This must have a negative performance impact on big pages with a lot of inputs as described in the question.
  • Si8
    Si8 about 10 years
    It adds colors for the borders which I don't want as it conflicts with the background image. Great idea though!