css无法以正确的方式加载字体

时间:2013-02-04 15:30:01

标签: html css

我必须从文件夹中将字体加载到css中,但它无法正常工作

HTML

是:

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
    <style>
        @font-face { font-family: 'HelveticaWorld'; font-style: normal; font-weight: bold; src: URL("../Fonts/HelveticaWorld-Bold.ttf") format('ttf'); }
    </style>
</head>
<body>
            <div style="margin-bottom: 15px; font-weight: bold;font-family: HelveticaWorld"">Setup</div>

</body>
</html>

download physical html file ( zip)

1 个答案:

答案 0 :(得分:1)

查看zip文件,您的字体路径和格式是错误的。尝试:

@font-face { font-family: 'HelveticaWorld'; font-style: normal; font-weight: bold; src: URL("font/HelveticaWorld-Bold.ttf") format('truetype'); }