Problems with the css font

Hi guys, I have this code in my css file from the @fontsquirrel generator

/// changed the code to the way it is now ///

@font-face { font-family: 'AdLibRegular'; src: url('../fonts/adlib-webfont.eot'); src: local('☺'), url('../fonts/adlib-webfont.woff') format('woff'), url('../fonts/adlib-webfont.ttf') format('truetype'), url('../fonts/adlib-webfont.svg#webfontmAc00Ivp') format('svg'); font-weight: normal; font-style: normal; } .AdLib { font-weight: normal; font-style: normal; line-height:normal; font-family: 'AdLibRegular', sans-serif; } 

this is stored in the css folder, and the fonts are stored in a folder called fonts.

I cannot get this to work when on an html page I call it, for example

 <h1 class="AdLib">Testing Testing 1 2 3</h1> 

I cannot understand what I am doing wrong.

Any ideas?

thanks in advance stu

//// Now I changed them all to url ('../fonts/adlib, etc., and it still doesn't work. I'm browsing locally - is that it?

+6
html css class fonts font-face
source share
2 answers

maybe a problem in the path where the font folder is located according to the css file?

if the font folder is in the css folder, you should use the following path:

 src: url('fonts/adlib-webfont.eot'); 

if next to the css map you need to use the following path:

 src: url('../fonts/adlib-webfont.eot'); 

../ used to return a folder

+8
source share

I'm having trouble with font-face where the url starts with '/' - try changing the src url as a relative url:

eg,

 @font-face { font-family: 'AdLibRegular'; src: url('../fonts/adlib-webfont.eot'); } 

(obviously, point to the correct folder location)

0
source share

All Articles