我必须从文件夹中将字体加载到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>
答案 0 :(得分:1)
查看zip文件,您的字体路径和格式是错误的。尝试:
@font-face { font-family: 'HelveticaWorld'; font-style: normal; font-weight: bold; src: URL("font/HelveticaWorld-Bold.ttf") format('truetype'); }