Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

CSS: Font-face not working on Chrome

CSS: Font-face not working on Chrome

Problem

How can I tell why the font is not being displayed?

I'm in Chrome - so .ttf should work. I checked that I can navigate to the file using my URL bar, and I can download it so permissions are fine.

I have a page that declares a @font-face:

@font-face {
  font-family: 'entypo';
  src: url('/css/fonts/entypo.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}

p { font-family: 'entypo'; }
Problem courtesy of: Don P

Solution

The @font-face cannot be within a block. Common practice is to have it at the top of the CSS file.

Your source:

#lookgram {
  @font-face {
    font-family: 'entypo';
    src: url("/entypo.eot");
    src: url("/entypo.eot?#iefix") format("embedded-opentype"), url("/entypo.woff") format("woff"), url("/entypo.ttf") format("truetype"), url("/entypo.svg#entypo") format("svg");
    font-weight: normal;
    font-style: normal;
  }

  @font-face {
    font-family: 'entypo_social';
    font-style: normal;
    font-weight: 400;
    src: url("/css/fonts/entypo-social.woff") format("woff");
  }

  margin: 0;
  font-family: "Helvetica Neue", Helvetica, Arial, "lucida grande", tahoma, verdana, arial, sans-serif;
}
Solution courtesy of: James Coyle

Discussion

View additional discussion.



This post first appeared on CSS3 Recipes - The Solution To All Your Style Problems, please read the originial post: here

Share the post

CSS: Font-face not working on Chrome

×

Subscribe to Css3 Recipes - The Solution To All Your Style Problems

Get updates delivered right to your inbox!

Thank you for your subscription

×