如何在网站上使用自定义字体? [英] How can I use custom fonts on a website?

查看:17
本文介绍了如何在网站上使用自定义字体?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为了让我的网站看起来不错,我需要使用自定义字体,特别是 Thonburi-Bold.问题是 - 除非用户安装了字体,否则不会显示字体.它也不显示在 Firefox 中.

In order for my website to look good I need to use a custom font, specifically, Thonburi-Bold. The problem is - the font does not get displayed unless the user has installed it. It also isn't displayed in firefox.

是否有解决此问题的方法?

Is there a workaround to this problem?

推荐答案

你必须像这样在你的样式表中导入字体:

You have to import the font in your stylesheet like this:

@font-face{
    font-family: "Thonburi-Bold";
    src: url('Thonburi-Bold.ttf'),
    url('Thonburi-Bold.eot'); /* IE */
}

这篇关于如何在网站上使用自定义字体?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆