Css 无法在我的静态目录中导入字体

Css 无法在我的静态目录中导入字体,css,Css,我正在使用以下CSS设置div中的文本样式: @font-face { font-family: 'Evolution'; src: ('/static/Evolution.ttf') format('truetype'); } .logo { font-family: 'Evolution', 'Arial', 'Times New Roman'; } 但它不起作用。我可以通过访问localhost:8000/static/Evolution来访问字体,所以我不认为URL

我正在使用以下CSS设置div中的文本样式:

@font-face {
  font-family: 'Evolution';
  src: ('/static/Evolution.ttf') format('truetype');
}

.logo {
    font-family: 'Evolution', 'Arial', 'Times New Roman';
}
但它不起作用。我可以通过访问localhost:8000/static/Evolution来访问字体,所以我不认为URL src是错误的,是吗?
还有什么其他想法吗?

您忘记了
url

src: url('/static/Evolution.ttf') format('truetype');
     ^^^

您忘记了
url

src: url('/static/Evolution.ttf') format('truetype');
     ^^^