skip to Main Content

I wan to set Barlow and Fraunces in my CSS. But every time i try to import and use that font family, there doesn’t seem to be any changes and font still seems to be Times New Roman.

I tried this

@import url(https://fonts.google.com/specimen/Barlow);
body{
    font-family: 'Barlow';
} 

2

Answers


  1. That’s because you have to include your font-weight and font-style properties in your CSS code:

    @import url('https://fonts.googleapis.com/css2?family=Barlow:wght@400;700&display=swap');
    
    body{
        font-family: 'Barlow', sans-serif;
        font-weight: 400;
        font-style: normal;
    }
    
    Login or Signup to reply.
  2. You can try this

    <link rel="preconnect" href="https://fonts.googleapis.com">
    <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
    <link href="https://fonts.googleapis.com/css2?family=Barlow:wght@100&display=swap" rel="stylesheet">
    
    
    <style>
    body { 
      font-family: 'Barlow', sans-serif;
    }
    </style>
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search