css load font code example
Example 1: otf css3 font-face
@font-face {
font-family: GraublauWeb;
src: url("path/GraublauWeb.otf") format("opentype");
}
Example 2: import font css
@font-face {
font-family: "Open Sans";
src: url("/fonts/OpenSans-Regular-webfont.woff2") format("woff2"),
url("/fonts/OpenSans-Regular-webfont.woff") format("woff");
}
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: css font face
@font-face {
// Defining what the font will be called
font-family: thisSpecialFont;
// Linking to the font file
src: url(linkToFontFile.woff);
}
body {
font-family: thisSpecialFont;
}
Example 5: how to link fonts css
@import url(//fonts.googleapis.com/css?family=Open+Sans);
/*When not hosting on my own server use the @import rule which is Google Fonts Versionn and hosted on their server*/