gpt4 book ai didi

html - 在 HTML 页面中添加额外的字体

转载 作者:太空宇宙 更新时间:2023-11-04 06:16:52 24 4
gpt4 key购买 nike

问题是如何将特定字体应用于整个页面?我在下面的例子中做了它,但它不起作用。只有当我将它应用到确切的标签时它才有效,如下所示:

<p style="font-family: Palatino Linotype; src: url({% static "fonts/Palatino.ttf" %})">Description-{{ current_boat.boat_description }}</p>
</div>
{%  load bootstrap4 %}
{% load static %}
{% load staticfiles %}
{% load thumbnail %}

<html lang="en">
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<title>Boat pdf</title>

<style type="text/css">

@font-face {
font-family: Palatino Linotype; src: url({% static "fonts/Arial.ttf" %});
}
body {
font-family: "Palatino Linotype", Arial, sans-serif;
color: #333333;
}

</style>
</head>
<body>


<p style="font-family: Palatino Linotype; src: url({% static "fonts/Palatino.ttf" %})">Description-{{ current_boat.boat_description }}</p>
</div>

<div class="row">
{% for instance in current_boat.images %}


<a href=" {{ instance.boat_photo.url}}"> <img class=" ml-3" src="{% thumbnail instance.boat_photo "default" %}"></a>

{% endfor %}

</div>


</body>
</html>




最佳答案

这可能是问题的原因

@font-face   {
font-family: Palatino Linotype; src: url({% static "fonts/Arial.ttf" %});
}

尝试用下面的替换它

@font-face   {
font-family: Palatino Linotype;
src: url({% static "fonts/Palatino.ttf" %});
}

关于html - 在 HTML 页面中添加额外的字体,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55878936/

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