Change Font in Html/Css File

Change Font in Html/Css File

I downloaded the source code of this online portfolio project but I don't know how to change that weird font family. can anyone help?

2

2 Answers

To change the font, you can add the @font-face in the CSS.

For example:

@font-face{
    font-family: Helvetica;
}

If you use another font like Roboto, you may need to add its source link:

@font-face{
    font-family: Helvetica;
    src: 'source link here',
}

Or you may just set in the text itself like this:

span {
  font-family: helvetica;
}

p {
  font-family: serif;
}
<span>Helvetica</span> <br>
<p>Serif</p>

In that repository, the font style is defined in:

Go to your CSS folder and to the fonts.css

/* @font-face */ 

@font-face{
font-family: "Roboto";
src: '../fonts/Roboto/Roboto-Regular.ttf';
}

then change this to any font you want. just download a new font pack online and replace the font folder. Then route that new font folder this css.

i.e

/* @font-face */ 

@font-face{
font-family: "super-cool";
src: '../fonts/super-cool/super-cool-Regular.ttf';
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

David Miller
Author

David Miller

David Miller brings 15 years of experience in global economics, personal finance strategy, and market dynamics. He specializes in turning complex economic trends into actionable insights for everyday readers.