+ 1
How to import font from pc memory?
In my Html folder (here all my html files are) there is a subfolder name Font. In there is my font file, name is font.ttf (renamed name. It was not the name when I downloaded it) I have written <style> @font-face { font-family: "font"; src: url("./Font/font.ttf"); } </style> Is it ok? suppose I wanna write a sentence inside <div> using this font. what should I write in code? can someone please write me it?
1 Respuesta
+ 2
Hello, my response will be incomplete but in addition to your code above, in the CSS further you will have to select your tag by its name,class or id and apply the propriety font-family.
Ex:
div{
font-family: name of your font , Arial,serif,sans-serif;
}
(But it seems your @font-face lack some elements like type or format if I remember not sure )
you can check here:
https://developer.mozilla.org/fr/docs/Web/CSS/@font-face
Have a good day.