font-face url does not load

Asked

Viewed 389 times

0

First of all, I warn you that I did not find anything in the searches that could solve my problem.

These are the paths of folders and files:

_pasta_da_html
    pagina.html
arquivo_da_fonte.ttf
css_com_font_face.css

In CSS, my code is like this:

@font-face{
    font-family: "nome_da_fonte";
    src: url("arquivo_da_fonte.ttf");
}

While in HTML, the code is like this:

<link href="../css_com_font_face.css" rel="stylesheet" type="text/css"/>
<style type="text/css">
    .fonte{
        font-family: nome_da_fonte;
    }
</style>
<div class="fonte">Testando... 1... 2... 3...</div>

I have already checked several times the path taken and it is correct, but it still doesn’t work, and no, I’m not using any php server, only pure html.

  • Which Web server (IIS, Apache, etc.) you are using?

  • I only use WAMP, but in this case, it’s for something different that I’m testing, and that possibly this error is also occurring on the servers, hence I’m in doubt

  • @Rick opens the page in Chrome and press F12, see if it appears any message on the Chrome console, usually this helps a lot to solve the problems, if there are any messages there that you do not understand, post here for us to analyze.

  • I ask why content streams may fail if the type is unknown / not registered on the web server.

  • It appeared this: Failed to load Resource: net::ERR_FILE_NOT_FOUND ... but in the case, the file exists, including I have tried several ways to change its path, but nothing that could solve, except to keep both in the same folder, which is not the case

  • You can access this file via browser using this direct path?

  • yes, I can, but nothing so far

Show 2 more comments
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.