skip to Main Content

Running WordPress with AWS Lightsail. This is the location of the uploaded font. I would use it for certain text.

enter image description here

Tried this:

@font-face {
    font-family: 'Icons';
    src: url(/icons.ttf);
    font-weight: normal;
    font-style: normal;
}

and this to define:

@font-face {
    font-family: 'Icons';
    src: url(/et-fonts/icons.ttf);
    font-weight: normal;
    font-style: normal;
}

none worked. What is wrong?

This is which I would apply for:

<span
  style={{ fontFamily: "Icons", fontSize: "2rem", cursor: "pointer" }}
>
  c
</span>;

2

Answers


  1. Ok, this is it:

    @font-face {
        font-family: 'Icons';
        src: url(/wp-content/uploads/et-fonts/icons.ttf);
        font-weight: normal;
        font-style: normal;
    }
    
    Login or Signup to reply.
  2. you should do like this.

    theme folder >> font folder >> font.ttf

    Please just remove first "/" in url.

    @font-face {
        font-family: 'Icons';
        src: url(/et-fonts/icons.ttf);
        font-weight: normal;
        font-style: normal;
    }
    

    change to

    @font-face {
        font-family: 'Icons';
        src: url(et-fonts/icons.ttf);
        font-weight: normal;
        font-style: normal;
    }
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search