ttf font css code example

Example 1: 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 2: If you're trying to use a package make sure that '../../static/fonts/lato/Lato-Regular.woff' is installed. If you're trying to use a local file make sure that the path is correct.

/** Use intstead */
@font-face {
  font-family: 'MyFont';
  src: local('MyFont'), url(fonts/MyFont.woff) format('woff');
}

Example 3: how to find a fontface url

@font-face {
	font-family: Chunkfive;
	src: url('Chunkfive.otf');
}

Tags:

Html Example