F
F
ferles2018-12-18 15:37:04
css
ferles, 2018-12-18 15:37:04

Why doesn't css see the font-family?

Hello everyone, I downloaded the fonts to my folder, I connect them (sass):

@font-face
  font-family: 'Lato'
  src: url('../fonts/Lato-Black.ttf') format('ttf')
  font-weight: 900

@font-face
  font-family: 'Lato'
  src: url('../fonts/Lato-Regular.ttf') format('ttf')
  font-weight: 400

@font-face
  font-family: 'PlayfairDisplay'
  src: url('../fonts/PlayfairDisplay-Regular.otf') format('otf')
  font-weight: normal

After connecting, fonts are not displayed if sans-serif is written in font-family along with the font name.
If you remove sans-serif, then the font is displayed adequately

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
tyzberd, 2018-12-18
@tyzberd

try

body {
font-family: 'Lato', sans-serif;
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question