import ttf in css code example

Example 1: how many fonts can i add in a css font-face

@font-face {
    font-family: CustomFont;
    src: url('CustomFont.ttf');
}

@font-face {
    font-family: CustomFont2;
    src: url('CustomFont2.ttf');
}

Example 2: use .ttf in css

@font-face {
  font-family:"Name-Of-Font";
  src: url("yourfont.ttf") format("truetype");
}

Example 3: how to link fonts css

@font-face {
  font-family: myFirstFont;
  src: url(sansation_light.woff);
}

div {
  font-family: myFirstFont;
}
/*Name the font-family and link the font file in the @font-face rule*/

Example 4: @font-face

@font-face {
 font-family: "The name of your font for your file";
 src: url("The link to your .ttf or .otf file");
}

Tags:

Css Example