gpt4 book ai didi

html - 字体不工作

转载 作者:行者123 更新时间:2023-11-28 17:22:59 24 4
gpt4 key购买 nike

我使用下面的代码通过@font-face 语句加载字体。字体在我的目录 yoo 中,但它不起作用:

    @font-face {
font-family: 'irseri’;
src: url('irseri.ttf') format('truetype');
}

.about{
text-align: left;
font-size: 18px;
font-weight: bold;
font-family:irseri ;
color: #9f9f9f;
margin-top: 10px;
}

这是我的 html 代码:

<!DOCTYPE html>
<html>
<head lang="en">
<link rel="stylesheet" href="style.css" type="text/css">
<meta charset="UTF-8">
<title>Mehdi page</title>
</head>
<body>
<div class="content">
<div class="text"><div class="image"></div>Some Title</div>
<div class="about">Some Text<div>
</div>
</body>
</html>

最佳答案

尝试这段代码并使字体文件夹正确。检查 irseri.ttf 字体是否在文件夹中,它可能喜欢 src: url('../fonts/irseri.ttf') format('truetype');

@font-face {
font-family: 'irseri';
src: url('../irseri.ttf') format('truetype');
}

关于html - 字体不工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27687089/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com