Custom font via CSS

Frankie Drake picture Frankie Drake · May 13, 2011 · Viewed 19k times · Source

I am learning php, html and css now and I'm trying to use a custom font on my site. I found the @font-face property that allows to make that, but it doesn't work. What am I doing wrong? css:

@font-face {font-family: LazurskiCTT;src:url(../sources/fonts/ie/LazurskiCTT Regular.eot);}
/*IE*/ 
@font-face {font-family:LazurskiCTT;src:url(../sources/fonts/LazurskiCTT Regular.Ttf);}
/*Other browsers*/
#myFonts{font-family:LazurskiCTT;}

html:

<p id="myFonts">Lazurski</p>

Maybe it's because I use it on my local machine? I run it in FireFox.

Answer

martnu picture martnu · May 14, 2011

The easiest (and best) way to get it to work is to use fontsquirrel's generator:

http://www.fontsquirrel.com/fontface/generator