1

I have this project with fonts, images and CSS files under the folder assets:

enter image description here

How I can import the fonts into this CSS file?

@font-face {
    font-family: lg;
    src: url(./assets/fonts/lgd641.eot?n1z373);
    src: url(./assets/fonts/lgd41d.eot?#iefixn1z373) format("embedded-opentype"), url(./assets/fonts/lgd641.woff?n1z373) format("woff"), url(./assets/fonts/lgd641.ttf?n1z373) format("truetype"), url(./assets/fonts/lgd641.svg?n1z373#lg) format("svg");
    font-weight: 400;
    font-style: normal;
}

Now I get not found.

enter image description here

4
  • Can you try url('assets/fonts/lgd641.eot?n1z373')? Commented Oct 22, 2019 at 15:48
  • Well, it's working. Commented Oct 22, 2019 at 20:28
  • Are you saying it's working with a path like 'assets/fonts/whatever`? Or was it a different change/pattern that allowed it to work? Commented Oct 22, 2019 at 20:40
  • yes with 'assets/fonts/whatever` it's working Commented Oct 22, 2019 at 20:44

2 Answers 2

1

Try changing the paths to the following:

@font-face {
    font-family: lg;
    src: url(assets/fonts/lgd641.eot?n1z373);
    src: url(assets/fonts/lgd41d.eot?#iefixn1z373) format("embedded-opentype"), url(assets/fonts/lgd641.woff?n1z373) format("woff"), url(assets/fonts/lgd641.ttf?n1z373) format("truetype"), url(assets/fonts/lgd641.svg?n1z373#lg) format("svg");
    font-weight: 400;
    font-style: normal;
}
Sign up to request clarification or add additional context in comments.

1 Comment

Do you know the solution for this? stackoverflow.com/questions/58512137/…
0

you can use ../fonts/file-name path to the font directory in place of ./assets/fonts in css file.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.