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

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

问题描述

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



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

解决方案



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


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天全站免登陆