user6442331
user6442331

Reputation:

Adding custom font to website (HTML/CSS)

I am currently trying to add a custom font to my website but it wont seem to work, I am not very good atm programming but my friend isn't home so I just wanted to get a solution for him. It currently works if using Calibri as font but any custom downloaded fonts dosent work. He is trying to use the HelveticaNeue font. The font is located in a folder called "fonts" in godaddy's server folder thing. Thanks! :) Here is the code:

@font-face {
 font-family: "HelveticaNeue";
    src: url("fonts/HelveticaNeue.otf);
     }





 h1{
    font-family: Calibri;
     letter-spacing: 6px;
     }

 p{
 font-family: Calibri;
 letter-spacing: 1px;
  }

Upvotes: 0

Views: 319

Answers (2)

Ogunleye Olawale
Ogunleye Olawale

Reputation: 306

Add a simple font-face

@font-face {
font-family: 'Typogrotesk'; /*a name to be used later*/
src: url('TheURLToTheFontFile'); /*URL to font*/

} then use it from css, html and javascript like this

This is for css

 .example {
font-family: 'Typogrotesk';  
 }

The best way that i use for all my custom font is to generate the neccessary code for my font using this fontsquirrel

Upvotes: 2

Rafv
Rafv

Reputation: 261

You need url that directed to the font, and helvetica neue is paid font. Use web safe font font-family: Helvetica, sans-serif; is easiest way to load helvetica

Upvotes: 1

Related Questions