gpt4 book ai didi

css - 为什么自定义字体未应用于我在 ASP.NET MVC 中的页面?

转载 作者:行者123 更新时间:2023-11-28 02:37:51 24 4
gpt4 key购买 nike

我正在尝试向网页添加自定义字体。我正在使用谷歌浏览器。

我在我的 CSS 中指定路径是这样的:

    @font-face {
font-family: ottosans_regular;
src: url(../Content/Fonts/ottosans-regular-1v32-webfont.woff);
}

像这样应用它:

    body {
font-family: ottosans_regular;
background-color: #F0F0F0;
}

最佳答案

字体文件可能没有正确加载...尝试在您的 web.config 中为 .woff 添加 mime 类型。

<system.webServer>
...
<staticContent>
<remove fileExtension=".woff" />
<mimeMap fileExtension=".woff" mimeType="application/font-woff" />
</staticContent>
</system.webServer>

更多信息 here

关于css - 为什么自定义字体未应用于我在 ASP.NET MVC 中的页面?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47328358/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com