Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Icon fonts not working in IE8

  • This topic is empty.
Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #42759
    simplybikes
    Participant

    I’m using icon fonts from Icomoon in my most recent project. They work perfectly in all browsers except IE8.
    What I get is a little box instead of the icon.
    Has anybody had a similar experience. My css looks like this:

    @font-face {
    font-family: ‘icomoon’;
    src:url (‘../fonts/icomoon.eot’);
    src: local(‘☺’), url(‘../fonts/icomoon.eot?#iefix’) format(’embedded-opentype’),
    url(‘../fonts/icomoon.woff’) format(‘woff’),
    url(‘../fonts/icomoon.ttf’) format(‘truetype’),
    url(‘../fonts/icomoon.svg#icomoon’) format(‘svg’);
    font-weight: normal;
    font-style: normal;
    font-variant:normal;
    }

    [data-icon]:before {
    font-family: ‘icomoon’;
    content: attr(data-icon);
    speak: none;
    font-weight: normal;
    line-height: 1;
    -webkit-font-smoothing: antialiased;
    }

    I then use the relvant icon in my html (data-icon=””)

    Anybody got any suggestions.

    Many thanks.

    #124763
    chrisburton
    Participant

    @font-face {
    font-family: ‘icomoon’;
    src:url (‘../fonts/icomoon.eot’);
    src: local(‘☺’),
    url(‘../fonts/icomoon.eot?#iefix’) format(’embedded-opentype’),
    url(‘../fonts/icomoon.woff’) format(‘woff’),
    url(‘../fonts/icomoon.ttf’) format(‘truetype’),
    url(‘../fonts/icomoon.svg#icomoon’) format(‘svg’);
    font-weight: normal;
    font-style: normal; font-variant:normal;
    }

    [data-icon]:before {
    font-family: ‘icomoon’;
    content: attr(data-icon);
    speak: none;
    font-weight: normal;
    line-height: 1;
    -webkit-font-smoothing: antialiased;
    }

    #124765
    chrisburton
    Participant

    Can we see a live site?

    #124776
    chrisburton
    Participant

    Weirddd. I think this has happened to a few others as well. What I would do is go back to icomoon and reselect those icons. When you click on font, you will see your icons within boxes. At the top of each box there is a question mark that you can click, give them a letter and use that for the data icon value.

    What I did for mine was use h (heart), d (dribbble), i (instagram), etc.

    #124781
    chrisburton
    Participant

    Nothing at all shows up for me in IE8 but I do see the `?` within a box in view source.

    #124795
    simplybikes
    Participant

    That’s interesting as I would have thought that the html code would appear in there, the likes of data-icon=””
    instead of just data-icon=”?”. Mmmmm

    #124797
    chrisburton
    Participant

    You get an x inside of a box, I get a ? inside of a box. That’s what I meant.

    #124813
    simplybikes
    Participant

    It’s a bit of a puzzler. IE9 is fine, IE7 nothing at all but that’s OK, IE 8 a box. I agree Josh, the icons are just not being recognised. What I’m going to do is use a different set of icons like Heydings icons and not using the data icon attribute but using psudo classes and see what happens. I think a bit of trial and error is called for. I’ll let you know what happens. Have a good weekend.

    #125097
    simplybikes
    Participant

    Chris / Josh…following on from the IE8 issue on Friday I’ve looked at various suggestions but none worked until I tried implementing the one here: http://andymcfee.com/2012/04/04/icon-fonts-pseudo-elements-and-ie8/.
    Basically I think it forces a page reload and it works once I ignore an error message that I get in relation to the following script:

    I get an error which says – Error: $ is undefined. Since looking at js for me is like looking into a black hole would you have any idea what the issue is.

    Many thanks.

    #125109
    simplybikes
    Participant

    can’t thank you enough.

    #125191
    simplybikes
    Participant

    Josh…just when I thought I was sorted I get this message:

    Error: ‘$.browser.msie’ is null or not an object

    My code is as follows:

    Any ideas? This approach definitely works as when I ignore that warning the page works fine everytime.

    #125194
    simplybikes
    Participant

    I am using 1.9.1 and testing the site on IETester to get it to work on iE8

    #125287
    simplybikes
    Participant

    Thanks Josh. You’re right about IE Tester as all sorts of weirdness started happening today when I changed the $.browser reference. The icons started to swop positions, absolutely bizarre.

    Am I on the right lines with the following:

    if ($.support.msie && 8 == parseInt($.browser.version)) { $(function() { var $ss = $(‘#base-css’); $ss[0].href = $ss[0].href; }); }

    or should I change ($.browser.version) to ($support.version).

    Thanks.

Viewing 13 posts - 1 through 13 (of 13 total)
  • The forum ‘CSS’ is closed to new topics and replies.