0

I have a font I downloaded and I'm trying to apply that font to my site.

so I simply used font-family but my font isn't there(obviously) any idea on how to add it?

Or Betzalel
  • 2,427
  • 11
  • 47
  • 70

3 Answers3

3

You have to embed the font via CSS before you can use it (since most computers probably don't have the font installed locally). Check out:

CSS Cross Browser Fonts using CSS3 @font-face

The cross-browser compatible code ends up looking something like:

@font-face 
{  
    font-family: "Your Font Name";  
    src: url(~/Fonts/SomeFontName.eot); /* IE */  
    src: local("The Real Font Name"), 
         url(~/Fonts/FontFileName.ttf) format("truetype"); /* non-IE */  
}  

body
{ 
    font-family:"Your Font Name", verdana, helvetica, sans-serif;  
}  
Justin Niessner
  • 242,243
  • 40
  • 408
  • 536
0

You simply write the name of the font, such as:

font-family: Gotham;

.. or ...

font-family: "Myriad Pro";

It will work on your machine but not on users' machines unless they have the font installed.

Tom
  • 30,090
  • 27
  • 90
  • 124
-1

I think the question is how can users of your site see the new font? Try this out: http://www.howtoplaza.com/how-to-use-custom-fonts-on-your-website-with-css

Such as this:

@font-face {
    font-family: cool_font;
    src: url('cool_font.ttf');
}
Brian Mains
  • 50,520
  • 35
  • 148
  • 257