1

So i wanted to add a custom font to my Html and CSS but i'm struggling to link the Html my font.

    style type="text/css">
@font-face {
    font-family: "Uni Sans";
    src: local(unisans) format("woff");
}
p.unisans { 
    font-family: "Uni Sans", Verdana, Tahoma;
}
</style> 
Johan
  • 39
  • 1
  • 6

2 Answers2

1

use Font Squirrel generator. But beware of the font license!

0

You cannot link a local font to your html or CSS. You need to convert the font you want to webfont, like Fontsquirrel. Download and unzip the files, place them into the folder of your html page or a new "fonts" folder located in the same folder as your html or CSS file. Then open the stylesheet.css that you get from Fontsquirrel, copy and paste the CSS of the font into your new css file and change the path of the font as you need. Then use the font 'name' in your CSS wherever you need.

DanielaB67
  • 460
  • 7
  • 14
  • I did all the steps but it still doesn't work – Johan Jun 18 '17 at 10:38
  • Can you please add your CSS and html, or send a link online so I can help? It might be that your paths are not correct or it's not working localy and you have to upload the files to ftp. – DanielaB67 Jun 18 '17 at 11:18
  • i figured it out now, the problem was that i didn't link stylesheet.css to my hmtl. Thank you so much, it helped me – Johan Jun 18 '17 at 11:20
  • I am glad you found the bug :) – DanielaB67 Jun 18 '17 at 11:21