Jump to content
CMSTOOLS.ru - форум поддержки и развития CMS

Как подключить шрифт в css


Recommended Posts

Привет!

Сайт https://4coders.pro/Unbrokenteam/index.html

Подключал шрифт по этим статьям:
https://www.cat-in-web.ru/podklyuchenie-shriftov-v-css/
https://moguta.ru/blog/delaem-internet-magazin-vmeste/kak-podklyuchit-shrift-na-sajt-v-css

В папку fonts на хостинге закачал Open Sans https://cloud.mail.ru/public/DsqH/bHBMnPvMv

В css прописал:
 

@font-face {
font-family: 'Open Sans';
font-weight: normal;
font-style: normal;
src: url(/fonts/OpenSans-Regular.eot); /* IE9 Compat Modes */
src: url(/fonts/OpenSans-Regular.eot#iefix) format('embedded-opentype'),
url(/fonts/OpenSans-Regular.woff) format('woff'),
url(/fonts/OpenSans-Regular.ttf) format('truetype'),
url(/fonts/OpenSans-Regular.svg#OpenSans-Regular) format('svg');
}
@font-face {
font-family: 'Open Sans';
font-weight: 700;
font-style: normal;
src: url(/fonts/OpenSans-Bold.eot); /* IE9 Compat Modes */
src: url(/fonts/OpenSans-Bold.eot) format('embedded-opentype'),
url(/fonts/OpenSans-Bold.woff) format('woff'),
url(/fonts/OpenSans-Bold.ttf) format('truetype'),
url(/fonts/OpenSans-Bold.svg#OpenSans-Bold) format('svg');
}


и применил здесь:
 

.myDivBlueBackground{
background-color: #FEE3B0;
padding: 20px;
font-family: "Open Sans";
}
.myDivWhiteBackground{
background-color: white;
padding: 20px;
font-family: "Open Sans";
}


Я все правильно сделал?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...