🇺🇸How to add your font to an HTML document. 🇷🇺Как добавить свой шрифт в HTML документ. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

🇺🇸How to add your font to an HTML document. 🇷🇺Как добавить свой шрифт в HTML документ.

🇺🇸 Please, help. How to add your font to an HTML document. 🇷🇺Пожалуйста помогите. Как добавить свой шрифт в HTML документ.

31st May 2020, 2:26 PM
Shen
Shen - avatar
4 Answers
+ 2
<head> <link rel="stylesheet" href="yourfileWithFonts"> <head> Ссылкой можно указать или ваш файл css, где есть настройка шрифтов в разных форматах. Либо использовать ссылку на googleFonts и его аналоги. Далее в основном файле css можно будет использовать название своего шрифта. Если речь идет просто о другом шрифте из стандартных. То в css: body { font-family: Helvetica, Arial, sans-serif; } можно это указать и в html в body в аттрибуте style - но использовать стили внутри html это ммм... считается не очень красивым подходом.
31st May 2020, 2:38 PM
BALU
BALU - avatar
+ 2
Use CSS @font-face definition. You should already have seen that in the CSS course: https://www.sololearn.com/learn/CSS/2264/
31st May 2020, 2:38 PM
Sandra Meyer
Sandra Meyer - avatar
+ 2
<Body style=" font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif;"> ..... The font-family property should hold several font names as a "fallback" system. When specifying a web font in a CSS style, add more than one font name, in order to avoid unexpected behaviors. If the client computer for some reason doesn't have the one you choose, it will try the next one. It is a good practice to specify a generic font family, to let the browser pick a similar font in the generic family, if no other fonts are available.
31st May 2020, 2:39 PM
Abdulsalam Al-Ashwal
Abdulsalam Al-Ashwal - avatar
+ 2
Спасибо большое вам всем! Thank you all very much!
31st May 2020, 3:56 PM
Shen
Shen - avatar