How Do I Change The Font of A Heading To A Font In The Same Folder As The HTML doc In HTML? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

How Do I Change The Font of A Heading To A Font In The Same Folder As The HTML doc In HTML?

Trying to figure this out, little confusing to me. Tried " <h1> <strong> <font-size 16> <style="font-family":"The Californication"> "Morgan & Conrad Realty.ttf" </h1>"

23rd May 2022, 10:33 PM
Acid Wolf
Acid Wolf - avatar
2 Answers
+ 1
adding local fonts: https://stackoverflow.com/questions/30020488/adding-local-ttf-fonts-using-font-face-in-css But doing that is not portable. Why not just use Google font?
23rd May 2022, 11:00 PM
Bob_Li
Bob_Li - avatar
+ 1
You need to create the font faces so the browser can differ between diferent weights and styles of the same font. The syntax for declaring a font face is: @font-face { font-family: <the font name that you will call later } src: <the url where the physical font file is stored> font-style: <the style of your font, can be italic, normal or oblique> font-weight: <the weight of the font file you are declaring> }
23rd May 2022, 11:46 PM
Victor Cortes
Victor Cortes - avatar