Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

@fontface not displaying

Featured Replies

Hi guys

 

Was hoping for some input with a problem I'm having with @fontface and firefox. Every other browser is rendering my site using the desired font, but firefox jumps to the next one in the font-family list (century-gothic in this case). It works fine on my machine at home but hen I ftp'd everything over to the remote server it stops working. Here is the @fontface code in the css for non IE browsers:

 

@font-face {

font-family: "avangeli";

src : url("../fonts/AVANGELI.ttf") format("truetype"),

url("../fonts/AVANGELI.svg#AVANGELI") format("svg");

}

 

And then I call it in the body css tag:

 

html, body {

background : #000 url('../images/lightsBackgroundSat.jpg') no-repeat fixed;

background-size : 100% 720px;

padding : 10px 50px 0 50px;

font-family : "avangeli", century-gothic, sans-serif;

font-weight : lighter;

color : #ffffff;

min-width : 1000px;

}

 

I have had this problem, and solved it, once before. That time the src url's were wrong. This time I'm completely stumped, and rather tired!

 

Here is the sites url too: www.cryhopecryfury.co.uk

 

Any help would be greatly appreciated!

  • Author

I get a 404 error when I go to the font file on your server, so it looks like you just haven't uploaded the TTF to that location.

 

According to your stylesheet it should be here: http://www.cryhopecryfury.co.uk/fonts/avangeli.ttf

 

If you type the name of the font in capitals in the url the 404 error doesn't come up, as such :here

 

if you look at the stylesheet code you will see the src calls the font file using capitals, which is the format of the actual ttf filename ('AVANGELI.ttf').

where are your .eot and .woff?

 

also I believe you need a comma after your first line:

 

src:url("../fonts/AVANGELI.ttf")  format("truetype"),
       url("../fonts/AVANGELI.svg#AVANGELI")  format("svg");

 

 

Just reread what you have in your OP, with a comma, but in your main.css you have

 

@font-face {
   font-family: "avangeli";
   src:url("../fonts/AVANGELI.ttf")  format("truetype")
       url("../fonts/AVANGELI.svg#AVANGELI")  format("svg");

}

Edited by zed

  • Author

Thanks for the replies! I decided to re-visit font squirrel and download a new kit. Having followed the original css code it supplies more truly things seem to be working now!

 

Thanks again guys!

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.