Wednesday, March 05, 2014

Fix: CSS border-radius not working in Internet Explorer 11

In doing browser compatibility testing in a new web form I was developing on my PC this morning, the form looked great in all browsers I had on my local Windows 8.1 PC – except for Internet Explorer 11, where it looked awful: div and form field border corners were squared instead of rounded, form fields rendered with excess height, some text was slightly truncated, and a few other issues.

When I looked at the CSS styles in use on the page in IE11’s built-in F12 developer tools, I noticed that the border-radius property on my form’s enclosing div was present, but it was missing its enable/disable checkbox, and the name of the style was shown with a red squiggle underline, as though IE didn’t recognize it.  It seemed almost as though IE11 was behaving like a legacy browser that didn’t recognize that newer CSS property.

In fact, that did turn out to be exactly the problem. IE11 was rendering the form (running on my local IIS) with its legacy “Compatibility View” engine, which it is by default configured to do for intranet sites.  (Oddly, my IE11 was not using Compatibility View to render another copy of the form that I was trying to use to debug the issue that I had IE loading via the “localhost” domain, which had me confused for a while.)

The solution was to disable IE11’s Compatibility View for intranet sites by doing Setting (gear icon) > Compatibility View Settings > uncheck “Display intranet sites in Compatibility View” checkbox.  Making that configuration change immediately got IE11 to start rendering the page properly.

47 comments:

  1. Thanks so much for this: you just saved my employer the cost of a new computer office window and possible lawsuit related to debris falling on the street below my office.

    ReplyDelete
  2. Thanks for the tip. I was having the same problem. I wonder how many tweaks I gave up using on the company's website just because it did not looked compatible on ie.

    ReplyDelete
  3. Yay - thank you!

    ReplyDelete
  4. Thanks a ton! Now if only other intranet users didn't have to go through this step :(

    ReplyDelete
  5. Hours I spent. Bloody hours. Why the clart was it rendering as IE5???? I'd buy you a drink if I could.

    ReplyDelete
  6. Thanks, this helped me as well! If I could ask a question, my ie is still not picking up my CSS styles though, how do I fix that, I tried: html data-useragent
    but still not working

    Any help would be appreciated

    ReplyDelete
  7. Thanks :-)

    Gracias, desactivandolo me funciono :)

    ReplyDelete
  8. Oh my god. You legend! Can not thank you enough!

    ReplyDelete
  9. Not in a million years would I have thought of this. I figured it was some compatibility thing and was going nuts. Thanks!

    ReplyDelete
  10. Thank you very very much

    ReplyDelete
  11. I thought I have finally got the answer for hours I spent (even just realizing it was the border-radius), yet working with Windows 8.1 and Internet Explorer 11, I still have an X pattern that crosses over all elements with radius-border (with F12 tools, if I remove the border-radius the issue is fixed) also after following your tip. It doesn't happen with Chrome on that same OS.
    I am speaking from a user point-of-view, and hopefully someone has an insight about it.

    ReplyDelete
  12. Спасибо тебе добрый человек! Ты помог мне!

    ReplyDelete
  13. Thanks a lot!

    ReplyDelete
  14. Thank you very much!

    ReplyDelete
  15. Thank you!

    ReplyDelete
  16. Thank you for saving my sanity :)

    ReplyDelete
  17. Thanks so much. Excellent solution.

    ReplyDelete
  18. Please guide me on this.
    I am running my application on ie 11 and border-radius works only when i run the application in incompatibility mode and whenever I try to run the application in compatible mode the image is again squared.
    I am working on asp.net, vs2010.
    thanks

    ReplyDelete
  19. Thank you so much!

    ReplyDelete
  20. This trick didnt work for me. But I did noticed that the IE 11 dev tool emulator was set to emulate IE 8 behavior. Once I switched it to Edge, border-radius worked like a charm.

    ReplyDelete
    Replies
    1. omg, mine was set to IE5 which is probably why nothing worked for me. thank you so much for this, you have no idea how many hours i spent troubleshooting and wondering why some tips worked for everybody else but me. :)

      Delete
  21. than you, save my life

    ReplyDelete
  22. I forgot about this - thanks for saving me hours!

    ReplyDelete
  23. Awesome! Thanks so much!!!

    ReplyDelete
  24. Brilliant, I have wasted so much time on this, It also fixed a giggling issue I had with an asp:menu.

    Thanks.

    ReplyDelete
  25. Like many others...I thank you for saving my precious hair from being ripped out of my head.

    ReplyDelete
  26. Thanks a lot. I wish that this is the first post I read regarding this issue. That could have really saved me some valuable time

    ReplyDelete
  27. You're genius and even more so for posting this. Fixed me up right quick in a hurry like! One quick question though ... some pages NEED that compat mode, I don't see any way to list just a SINGLE page and NOT a whole website in the compat settings ... is there anyway you know of do just let a SINGLE page run in compat mode? Thanks again!!

    ReplyDelete
  28. I cannot begin to thank you enough! I have been toying with compatibility settings and changing css to no avail. All I needed to do was turn compatibility off!

    ReplyDelete
  29. I have wasted so much of time for this bloody problem.great thank you.

    ReplyDelete
  30. THIS was the magic tag that made my page work. Thank you! I actually gasped when it worked. I've been fighting IE11 for two days. Gradients and rounded corners did not work until I set this meta tag.

    ReplyDelete
  31. You rock!!!

    ReplyDelete
  32. Hey, now that is really something. While the solution provided in the article requires the user to do something (over which you have no control), your solution is simply the gem I was looking for as it does the job perfectly.

    Thank you Anonymous :)

    ReplyDelete
  33. Thanks!!!! This specifically didn't work for me because the inspector kept switching to IE8 but once I changed the version in the inspector it worked!! So much time wasted. Thanks again!

    ReplyDelete
  34. Thank you for that solution. Learnt something.

    ReplyDelete
  35. I spent hours on a solution, but you probably saved me many days, thank you.

    ReplyDelete
  36. Thank you very much! I had everything running under safari, chrome and firefox. All the sudden things stopped showing up different on IE 11 including functionality. This solved my problems!

    ReplyDelete
  37. Thanks man!

    ReplyDelete
  38. This comment has been removed by the author.

    ReplyDelete
  39. Great! It solved my problem too
    I wonder when sense to set it up from codebehind.

    ReplyDelete
  40. Thank you so much ...

    ReplyDelete
  41. Thank you very much! I almost ditched using a nice jQuery tooltip on our intranet site because of this issue.

    ReplyDelete
  42. Another solution is to force IE to not render in compatibility mode by putting this in the head section of your page:

    (meta http-equiv="X-UA-Compatible" content="IE=edge" /)

    Replace the brackets with HTML braces (I had to escape them that way for this message to post)

    Regards
    Julian C

    ReplyDelete

Non-spammers: Thanks for visiting! Please go ahead and leave a comment; I read them all!

Attention SPAMMERS: I review all comments before they get posted, and I REPORT 100% of spam comments to Google as spam! Why not avoid getting your account banned as quickly -- and save us both a little time -- by skipping this comment form and moving on to the next one on your list? Thanks, and I hope you have a great day!