【问题标题】:Browser does not support my own font in asp.net浏览器不支持我自己在 asp.net 中的字体
【发布时间】:2017-05-25 06:53:57
【问题描述】:

我想在我的 .aspx 中嵌入我自己的字体,但 google chrome 和 firefox 不支持该字体,而 IE 支持该字体。让我知道如何在 asp.net 页面中嵌入字体。

我的代码是,

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title>Font</title>

<style type="text/css">

.title
{
    @font-face 
{
    font-family: Mullai;
    src: url('F:\ASP\SAMP - Mullai.ttf')format("truetype");
}
}
</style>
</head>

</body>
<form id="form1" runat="server">
<div>
<table style="width: 100%;">
<tr>
<td style="width: 91px">&nbsp;</td>
<td align="center" style="width: 351px" class="title">தமிழ்<br /></td>
<td style="width: 91px">&nbsp;</td>
</tr>
</table>
</div>
</form>
</body>
</html>

chrome 和 firefox 不调用 css 类。让我知道它有什么问题。提前致谢

【问题讨论】:

  • 这里src: url('F:\ASP\SAMP - Mullai.ttf')format("truetype");的路径不对。您应该在服务器中上传字体文件并使用相对路径
  • @Tasos K 那个浏览器不能接受本地路径吗??
  • 是的,物理路径在大多数情况下都不起作用。
  • 但它适用于 Internet Explorer。我也在服务器中上传字体后尝试过,它不起作用。在 chrome 或其他浏览器中是否有任何格式可以显示???它是一个 Intranet 应用程序。我想在局域网系统中显示字体。
  • 在这里查看示例netavatar.co.in/2011/05/01/…

标签: javascript html css asp.net fonts


【解决方案1】:

我之前也遇到过类似的问题,可能是配置文件的问题。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-04-19
    • 2015-05-02
    • 1970-01-01
    • 2012-06-22
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多