【问题标题】:how to upload custom font w/ django project如何使用 django 项目上传自定义字体
【发布时间】:2022-09-24 05:27:26
【问题描述】:

我正在开发一个带有 Django 的项目,但我遇到了字体问题。我可以在电脑上看到上传的字体,但在手机上看不到。

这是我的文件路径:

static
 |
 interface
  |
  main.css
  folsom-black.otf

这是我的 html 文件的代码:

    <style>
    @font-face {
      font-family: \'Folsom\';
      src:
           url(\"{% static \'interface/folsom-black.otf\' %} format(\'otf\')\");
    }
    </style>

这是我的 css 文件的代码:

    @font-face {
       font-family: \'Folsom\';
       src:
         url(\'../interface/folsom-black.otf\') format(\'otf\');
    }

    标签: python html css django django-staticfiles


    【解决方案1】:

    This 帖子可能会对您有所帮助!我自己不是 Django 的专业人士,但看看这是否对你有帮助!

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-08-31
      • 2018-02-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-02-19
      相关资源
      最近更新 更多