how to link fonts in html code example
Example 1: how to link fonts css
@font-face {
font-family: myFirstFont;
src: url(sansation_light.woff);
}
div {
font-family: myFirstFont;
}
Example 2: how to add font otf format in html
@font-face {
font-family: 'lovelyFont';
src: url('fonts/lovely_font.eot');
src:
local('Lovely Font'),
local('Lovely-Font'),
url('fonts/lovely_font.otf')
format('opentype');
}
@font-face {
font-family: 'lovelyFont';
src: url('fonts/lovely_font_bold.eot');
src:
local('Lovely Font Bold'),
local('Lovely-Font-Bold'),
url('fonts/lovely_font_bold.otf')
format('opentype');
font-weight: bold;
}
div { font-family: 'lovelyFont', sans-serif; }
span { font-weight: bold; }
Example 3: how to link fonts css
@import url(//fonts.googleapis.com/css?family=Open+Sans);
Example 4: how to choose font in html
font-family: