【问题标题】:Reloading my font on website在网站上重新加载我的字体
【发布时间】:2011-07-18 08:09:05
【问题描述】:

我们在网站上使用了一些非基本字体,但问题在于重新加载 - 您可以看到基本字体,然后在每个页面上重新加载到我们的字体。它可能缓存它或以某种方式将其保存到客户端?在每个页面上重新加载都很糟糕。

网址:http://ktwebstudio.cz/

我们正在使用 Windows 托管和 ASP.NET。

我找到了:

<system.webServer>
    <staticContent>
        <clientCache cacheControlMode="UseMaxAge" />
    </staticContent>
</system.webServer>

一切正常。

【问题讨论】:

标签: asp.net html caching client-side custom-font


【解决方案1】:

如果您的意思是在您的网页上使用自定义字体,那么 CSS 是最好的方法。它工作得很好,我可以从个人经验告诉你。以下是你的做法:

注意:

  • 您可以使用以下示例定义任意数量的自定义字体。
  • Internet Explorer 使用 EOT 字体而不是 TTF。
  • 使用您指定的字体系列来使用网页中的字体。

    @font-face
    {
        font-family: name_of_font;
        src: 
            url('url of name_of_font.ttf' */), 
            url('url of name_of_font.eot' */);
    }
    


例子:

<p style="font-family: name_of_font; font-size: 100%;"> Your text here with the custom font you specified... </p>

【讨论】:

    【解决方案2】:

    不,即使字体被缓存,也无法停止将基本字体重新加载到嵌入的 CSS3 字体!这是一个网络浏览器问题。有些网络浏览器会这样做(Opera),有些则不会(IE9)。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-11-03
      • 2015-08-31
      • 2016-02-18
      • 2017-11-07
      • 2021-11-22
      • 2018-01-14
      • 2021-04-05
      • 2016-07-17
      相关资源
      最近更新 更多