Search code examples
phpfontsopentype

Using otf file as font for website


I"m trying to use an otf file as my font for my website, but for some reason it's not changing the font to it at all. I downloaded the zip for the otf file, but the only file I uploaded to my directory is the FontAwesome.otf file. What am I doing wrong?

@font-face { 
font-family: 'FontAwesome'; 
src: url('FontAwesome.otf') format('opentype'); 
} 
body { 
font-size: 36px; 
} 
#div1 { 
font-family: 'FontAwesome'; 
border: 1px solid red; 
} 

<div id = 'div1'> The quick </div> The quick

Solution

  • 1) You have to specify full path or relative path from php script to font file in src: url 2) your browser has to support otf fonts