T
T
Tutucu2016-03-13 21:20:38
css
Tutucu, 2016-03-13 21:20:38

Some fonts crash when transferring a site to a hosting. What's wrong?

Good afternoon, I made up a page, pulled it on cms (Wordpress), set up bases and addresses - everything works, but some fonts have fallen off (just some: there are 5 in total), they work on the local server, but they don’t want to on the hosting itself. Fonts are used for headings, but not for the rest of the text. What is the problem ? CSS:

@font-face {
    font-family: days_sans; /* Гарнитура шрифта */
    src: url(fonts/dayssansblack.ttf); /* Путь к файлу со шрифтом */
   }

@font-face {
    font-family: troika; /* Гарнитура шрифта */
    src: url(fonts/troika.ttf); /* Путь к файлу со шрифтом */
   }

@font-face {
    font-family: cousine; /* Гарнитура шрифта */
    src: url(fonts/cousine.ttf); /* Путь к файлу со шрифтом */
   }
@font-face {
    font-family: americantext; /* Гарнитура шрифта */
    src: url(fonts/americantext.ttf); /* Путь к файлу со шрифтом */
   }

body{
    color: #fff;
    font-family: cousine;
}

h2{
    color: #fff;
    font-family: troika;
    font-size: 45pt;
    margin: 50px 0;
}

h3{
    color: #fff;
    font-family: troika;
    font-size: 25pt;
    margin: 25px 0;
}

h4{
    font-family: troika;
    font-size: 15pt;
    margin: 15px 0;
}

Cousin does not work.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
M
mletov, 2016-03-13
@Tutucu

1) try to set absolute from the root
of the type
2) Check the case in the font name and registered in css (sometimes in file managers there is a forced conversion to lower case when transferring via ftp)
3) Check for the presence of the files themselves, just in case, re-upload the folder with fonts

S
Sergey Goryachev, 2016-03-13
@webirus

And it would be nice to use a cross-browser connection method.

@font-face {
    font-family: 'helveticaneuecyr_roman';
    src: url('../font/helveticaneuecyr_roman.eot');
    src: url('../font/helveticaneuecyr_roman.eot?#iefix') format('embedded-opentype'),
         url('../font/helveticaneuecyr_roman.woff2') format('woff2'),
         url('../font/helveticaneuecyr_roman.woff') format('woff'),
         url('../font/helveticaneuecyr_roman.ttf') format('truetype'),
         url('../font/helveticaneuecyr_roman.svg#helveticaneuecyr_roman') format('svg');
    font-weight: normal;
    font-style: normal;
}

And I will supplement the answer mletov .
Also check the permissions on the CHMOD files.

P
Pavel, 2016-03-13
@Palych_tw

Look not at CSS, but at the page's source code. What is the path to the css file in there? You may have moved the site crookedly and the database still contains links to the local host.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question