CSS3 font-face

Before CSS3 it was quite impossible to embed custom fonts in your design, so if you really wanted to use something out of the ordinary -- like a heading in a "weird" font -- you were bound to using images. The practice was so corny that no designer was using it. 

Nowadays you can simply create your custom font class with the @font-face declaration. Specify the path to your TTF or OTF font and use it like any other font-family CSS property. 

HTML Example:

This text uses MyCustomFont

CSS Example:

@font-face { font-family: MyCustomFont; src: url('/path/to/my/font/file.otf'); } 

#custom { font-family: MyCustomFont; }  

Share

Learn how to design amazing websites