M
M
Marik Zukor2016-01-06 13:21:11
css
Marik Zukor, 2016-01-06 13:21:11

Why don't fonts work through font-face?

html code

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Document</title>
  <link rel="stylesheet" href="main2.css">
</head>
<body>
  Lorem ipsum dolor sit amet, consectetur adipisicing elit. Perferendis, numquam?
</body>
</html>

CSS Code
@font-face {
    font-family: 'FiraSans';
    src: url('fonts/firasans/firasans-regular-webfont.eot');
    src: url('fonts/firasans/firasans-regular-webfont.eot?#iefix') format('embedded-opentype'),
         url('fonts/firasans/firasans-regular-webfont.woff2') format('woff2'),
         url('fonts/firasans/firasans-regular-webfont.woff') format('woff'),
         url('fonts/firasans/firasans-regular-webfont.ttf') format('truetype'),
         url('fonts/firasans/firasans-regular-webfont.svg#Fira Sans') format('svg');
    font-weight: normal;
    font-style: normal;
}

body {
  font-size: 24px;
  font-family: 'FiraSans';
}

I put another font instead of 'Fira Sans', although Arial works, but it doesn't. The root folder is fonts//firasans/. The main2.css and main2.html files are in the same directory as fonts

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Karvasarny, 2016-01-08
@megapihar6

check the name of the fonts and most likely the path is not correct, look through the fire bug, you may need to add ../ or /

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question