@font-face {
font-family: webfont;
src: url(sansation_light.woff);
}
div {
font-family: webfont;
}
Define the font name in the font-family property after using the font-family name in HTML elements.
Detailed define @font-face in CSS
@font-face {
font-family: Poppins;
src: url('fonts/'Poppins'.eot');
src: url('fonts/'Poppins'.eot?#iefix') format('embedded-opentype'),
url('fonts/'Poppins'.woff') format('woff'),
url('fonts/'Poppins'.ttf') format('truetype'),
url('fonts/'Poppins'.svg') format('svg');
font-weight: normal;
font-style: normal;
}
@font-face allows to use of custom fonts used in webpages. Once added in the css file, the rule commands the browser to use the fonts where web font is hosted then fonts working with your webpage.
Without define @font-face, a webpage is limited to fonts and displays already loaded on the user computer.