如何加载自定义字体?

时间:2015-10-22 17:32:04

标签: html css fonts

我的字体是http://www.dafont.com/milasian-circa.font?text=

我将TTF保存在与HTML文件相同的文件夹中

我的CSS看起来像

@font-face { font-family: 'Milasian Circa PERSONAL'; src: url('MilasianCircaMediumPERSONAL.TTF'); } 

h1,
h2,
h3,
h4,
h5,
h6 {
    margin: .67em 0;    
    text-align: center;    
    color: FloralWhite;
    font-family: 'Milasian Circa PERSONAL','Open Sans', 'Helvetica Neue', Arial, sans-serif;
}

在我的html文件中

<h1><span>Test Message</span></h1><br><h3><span>Wednesday, October 28, 2015</span></h3>

我希望我的自定义字体能够显示,但事实并非如此。它显示Arial

1 个答案:

答案 0 :(得分:0)

使用此链接,它将创建各种格式的字体以供使用,并为您提供要使用的HTML代码

http://www.font2web.com/

相关问题