Answer the question
In order to leave comments, you need to log in
How to connect a TTF font to the site in four different styles (regular, italic, etc.)?
There is a font in TTF: https://fontsup.com/family/opel+sans.html
And I need to connect it to the site, sort of like Google Fonts.
What is the required sequence of steps?
1. For example, to connect Fira, I place a meta tag on the page:
<link href="//code.cdn.mozilla.net/fonts/fira.css" rel="stylesheet" type="text/css" />
font-family: 'Fira Sans';
Answer the question
In order to leave comments, you need to log in
Now you do not need to connect ttf, you need woff2 and woff
Connect like this (the file name must be the same, the style and boldness change)
@font-face {
font-family: "OpenSans";
src: url("fonts/opensans.woff2") format("woff2"),
url("fonts/opensans.woff") format("woff");
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: "OpenSans";
src: url("fonts/opensansbold.woff2") format("woff2"),
url("fonts/opensansbold.woff") format("woff");
font-weight: 700;
font-style: normal;
}
div {
font-family: OpenSans, Arial, sans-serif;
font-weight: bold;
}
All the same. It is necessary to connect 4 fonts with different styles.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question