Adding a new font to my html file (newbie here!)

Hey guys and girls,

I’m very new to html-coding and only understand the very basics so far. I would like to add a new font to my html file, because it is not available by standard. I have downloaded a zip.-file of the font and don’t really know what to do now.

Thanks :slight_smile:

u can do that with css, if eg. i want to target the h element

h {
  font-family: "Times New Roman";

You need to tell the web browser where your font file is stored so that it can use it on your web page. You would do this with the @font-face rule.

One thing to remember is that if you want everyone to see this font then you have to upload the font file(s) to the web server your page is hosted on. And the file paths in your @font-face rule need to be relative to the CSS file.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.