30

On my website I have noticed that there is a substantial difference in text quality between Firefox, Chrome, and Internet Explorer. While the text is crystal clear in Chrome, and even more so in Firefox, it seems blurred and out-of-focus in Internet explorer. Here is a picture comparison:

Screenshot comparison of Firefox and IE

Personally I think it is not aesthetically pleasing to the eye. I would like to find a solution without asking users to use plugins like Microsoft Silverlight, as not all users will want to install a plugin just to view 1 website. I don't understand how websites like Facebook and StackOverflow don't have this problem (or at least less of a problem).

I've tried using CSS filters, different font-rendering properties, and using different units for font-size, but I'm seeing no effect. I know I haven't tried all possible CSS property combinations so this could still be the answer.

I've been scouring the web and StackOverflow for hours now, and have yet to find a solution. There are other similar questions here but they remain unanswered.

Any help, or idea of where to go or what to do, is very much welcomed. Run this Snippet in different browsers if you can't see the image or website:

html,body{
  margin:0;
  height:100%;  
  font: normal 14px/24px "Lucida Sans Unicode","Lucida Grande", "Arial", sans-serif;
}
.popup{
  position:relative;
  top:50%;
  left:50%;
  text-align: center;
  vertical-align: middle;
  display: inline-block;
  white-space: nowrap;
  background-color:rgb(28, 31, 37);
  color:white;
  padding:1em;
  z-index:2;
  transform: translate(-50%,-50%);

  -webkit-box-shadow: 0px 0px 14px -2px rgba(0,0,0,0.75);
  -moz-box-shadow: 0px 0px 14px -2px rgba(0,0,0,0.75);
  box-shadow: 0px 0px 14px -2px rgba(0,0,0,0.75);
}
p{
  font-size: small;
}
input{
  padding: 16px 12px;
  width: 250px;
  border: 0;
  background: #0A0A0A;
  color: #eee;
  font-size: 14px;
  font-family: "Open Sans",sans-serif;
  -webkit-box-shadow: inset 0 0 0 1px #323742;
  -moz-box-shadow: inset 0 0 0 1px #323742;
  box-shadow: inset 0 0 0 1px #323742;
}
#blackout {
  background: rgba(17,19,23,.5);
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 1;
  cursor: pointer;
}
<div id="blackout"></div>
<div class="popup">
  <h1>Compare this text</h1>
  <p>And this text as well</p>
  <input type="text" placeholder="Even placeholders are blurry">
</div>

Strangely, the Snippet looks similar in different browsers: but looking carefully there are definite differences though. Chrome (Version 44.0.2403.125 m) seems to have a sharp edge effect. IE (11) seems to have a slight blur. Whereas Firefox (38.0.1), as explained by @user4749485, seems to have selected the best of both worlds to achieve the best legibility. Is there a way to manually calculate and adjust the font for IE only? (Another possible method to fix it.)

I'm not sure where the rest blur is coming from (the Snippet's text seems clearer here, than the text on my website). If we can uncover where this difference comes from then perhaps this will be easier to solve. (I have been adding/removing CSS to the Snippet so forgive all the edits)

TL:DR, and just to elaborate the question: I would like the text to look clear in IE like it does in Firefox or Chrome.


Comparison for Sergey Denisov's answer:

Chrome and IE before and after picture comparison While I could use Srikanth Pullela's answer to apply this CSS transform to IE only, I am curious as to whether there is an all browser fix. Edit: I'll use method mentioned above as the proposed fix causes this to happen meaning I can't rely on GPU rendering to render it correctly:

Bugged look of the popup

8
  • Wow, that's actually very useful! Many thanks for that input, it's good to know how & why Firefox's text looks clearer :) All we need now is to forcibly apply the same technique in IE...
    – jaunt
    Jul 27, 2015 at 16:13
  • 2
    It could be the font rendering for open sans, there is a question specificly for open sans in UX Stack Exchange ux.stackexchange.com/questions/33556/…
    – Engin
    Jul 31, 2015 at 17:18
  • Interesting, but it seems strange that they still haven't fixed the font hinting after so many years. Besides this doesn't explain why Lucida is blurry as well, but thanks for the input @Engin: uncovered a new possibility :)
    – jaunt
    Jul 31, 2015 at 17:34
  • @jaunt Have you tried using pt instead px for font size? I don't see the blurry effect on Win 7, IE 11 so I couldn't test with other fonts but I'd try Verdana first since it seems like it's the the most hinted. I wouldn't say font hinting is something to be fixed but rather to be optimized, thus it's not the font but the size of the font and in your case size in pixels will differ by the resolution and will be rendered differently.
    – Engin
    Jul 31, 2015 at 18:01
  • @Engin I have tried using both different fonts and font size units once again: neither seem to have much of an effect (although I only changed them via IE's inspection panel and not by editing the file - if that makes a difference). The blur is hard to see with only IE open: having Chrome or FireFox open besides it should make it stand out more (I'd be very disappointed if this turned out to be an OS specific bug... :/ ).
    – jaunt
    Jul 31, 2015 at 22:45

7 Answers 7

9
+25

The only thing I suggest is to use the code below and write separate CSS, so when opened in IE it will take that css only.

This will target only earlier versions of IE8:

 <!--[if lt IE 8]>
<link href="./Content/ie7.css" rel="stylesheet" />
  <![endif]-->

If you want to target all IE versions, use this:

<!--[if IE]>
<link rel="stylesheet" type="text/css" href="all-ie-only.css" />

4
  • 1
    The trouble is knowing what CSS to write. There are many ways to import different style-sheets but this one is definitely the best for this scenario - so thank you for that input :)
    – jaunt
    Aug 3, 2015 at 15:00
  • 2
    Yes it helps, but it's not an answer to my problem. I need to know how to fix it: not how to implement the fix.
    – jaunt
    Aug 3, 2015 at 15:15
  • 1
    SO in the IE css file Add the opacity : 0.5; css property and see the output Aug 3, 2015 at 15:16
  • 1
    So you're saying that simply adding opactity:0.5; fixes the problem? Now I am really confused. I understand what your code does. But it does not fix the clarity of the text in IE.
    – jaunt
    Aug 3, 2015 at 15:31
5

Did you try to add translateZ(0) for your popup? In your case it could be:

.popup {
    ...
    -webkit-transform: translate3d(-50%, -50%, 0);
    transform: translate3d(-50%, -50%, 0);
    ...
}

In IE11 on Windows 8.1 the font looks better: Popup with translateZ(0) hack

html, body {
    margin: 0;
    height: 100%;
    font: normal 14px/24px "Lucida Sans Unicode", "Lucida Grande", "Arial", sans-serif;
}

.popup {
    position: relative;
    top: 50%;
    left: 50%;
    text-align: center;
    vertical-align: middle;
    display: inline-block;
    white-space: nowrap;
    background-color: rgb(28, 31, 37);
    color: white;
    padding: 1em;
    z-index: 2;

    -webkit-filter: blur(0);
    -webkit-transform: translate3d(-50%, -50%, 0);
    transform: translate3d(-50%, -50%, 0);

    -webkit-box-shadow: 0px 0px 14px -2px rgba(0, 0, 0, 0.75);
    -moz-box-shadow: 0px 0px 14px -2px rgba(0, 0, 0, 0.75);
    box-shadow: 0px 0px 14px -2px rgba(0, 0, 0, 0.75);
}

p {
    font-size: small;
}

input {
    padding: 16px 12px;
    width: 250px;
    border: 0;
    background: #0A0A0A;
    color: #eee;
    font-size: 14px;
    font-family: "Open Sans", sans-serif;

    -webkit-box-shadow: inset 0 0 0 1px #323742;
    -moz-box-shadow: inset 0 0 0 1px #323742;
    box-shadow: inset 0 0 0 1px #323742;
}

#blackout {
    background: rgba(17, 19, 23, 0.5);
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1;
    cursor: pointer;
}
<div id="blackout"></div>
<div class="popup">
    <h1>Compare this text</h1>
    <p>And this text as well</p>
    <input type="text" placeholder="Even placeholders are blurry">
</div>

P.S. Added -webkit-filter: blur(0) to fix blurring text in Chrome 44 on Windows 7/8.1 from this post.

6
  • Wow that does actually fix it for IE. I'm curious as to why though, how did you figure this out? Unfortunately, for some reason this method blurs the text in Chrome. (Firefox remains perfect.)
    – jaunt
    Aug 17, 2015 at 20:08
  • @jaunt when you do something with transform/transition, very often you have problems with any browser rendering. I don't know why, it may be bugs or something else. transform: translateZ(0) enable GPU rendering in your browser, and it often helps the browser render things correctly. You could google it, also read article I included into post — aerotwist.com/blog/on-translate3d-and-layer-creation-hacks. Aug 18, 2015 at 9:42
  • @jaunt I improved the answer, check it now. Added -webkit-filter: blur(0) for Chrome from this post — stackoverflow.com/questions/20377990/…. Aug 18, 2015 at 9:43
  • @jaunt did you try it? Aug 19, 2015 at 22:44
  • Yes, well done it does work :) However every so often I get graphical glitches but I never capture them so I'm currently trying to reproduce it to add a picture off one of the errors. I know this is probably a bug out of our control but I want to be sure that there are no known fixes for this.
    – jaunt
    Aug 20, 2015 at 9:52
4

Use Embedded OpenType (EOT) file (.eot or .ote format) of that font-family which you are using.

2
  • Well I'm using Lucida Sans Unicode which is a web-safe font: I'm not selecting a file for this font, I'm just using whatever the browser gives me.
    – jaunt
    Aug 4, 2015 at 13:57
  • Then You should use default fonts Arial, Helvetica, sans-serif it would help you. Aug 6, 2015 at 12:51
3
  1. Open IE Tools and select Internet Options.
  2. Then go to Advanced and unchecked "Always use ClearType for HTML".
2
  • 5
    Are you expecting every user who visits the website to do this?
    – freefaller
    Jul 27, 2015 at 10:58
  • IE was tagged in the question, so this is one of possible solutions. In my IE I do not see blurred fonts at all, so the issue may be OS or IE settings for ClearType.
    – skobaljic
    Aug 7, 2015 at 8:06
1

I have faced same issue within IE-11 windows 10, finally able to resolve it through replacing translate3d(tx, ty, tz) with translate(tx,ty)

Old usage

.show_panel { transform: translate3d(0, 100%, 0); }

New Usage

.show_panel ( transform: translate(0, 100%); }

and it worked for me, for details: https://github.com/angular/material/issues/4544

0

Actually this seems to be due to rounding errors. If you encounter the problem with a resizeable window the fixes suggested here wont work. If the text get blurred for a specific size with 2d translate, you can fix it by using 3d translate and vice versa. however, if the window is resized there will always be certain window sizes that result in blurred text.

0

I got this resolved doing the following: Internet Explorer 11 > Tools > Options > Advanced: Accelerated Graphics: Use software rendering Yes Accesibility: all check-boxes as No

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.