guys, I'm having trouble with importing fonts from an otf file
main.css
@font-face {
font-family: 'testfont';
src: url('fonts/test.otf');
}
.fonttest {
font-family: 'testfont';
}
main.html
<p class="fonttest">TESTtest</p>
But still when I try start the homepage it shows the standard font of html. When I use the inspector on my browser opera and chrome it says that the font was accepted
Add a font-face section to your CSS code src: url('fonts/lovely_font. otf') format('opentype'); src: url('fonts/lovely_font. ttf') format('truetype'); As another optional efficiency measure, we can get the browser to check for a local copy of the font in case the user already has it.
There is really no issue for the end user as almost all modern applications that uses fonts are able to work with TTF and OTF files. Users don't need to choose one over the other as they can be used together in creating documents or printing layouts.
use this;
@font-face {
font-family: testfont;
src: url("fonts/test.otf") format("opentype");
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With