这是一个非常简单的问题,我不知道答案。我是一个初学者。 由于某种原因,我无法更改字体系列。我可以在物理上键入不同的内容,但它根本不会更改字体。这是我的代码:
setGeneric
答案 0 :(得分:1)
您需要在项目中包含所需的字体(您的情况下为google字体)。 您可以通过多种方式做到这一点。一种是在HTML中为其添加链接
您还可以快速浏览一下此documentation
其他方式:
使用@import url('https://fonts.googleapis.com/css2?family=Alegreya+SC');
或
下载字体并将其包含在您的项目中,然后将其导入
与@import(pathToFont)
.left {
width:800px;
margin:auto;
text-align:center;
box-sizing:border-box;
background-color:#FFEBCD;
border:2px solid black;
font-family: 'Alegreya SC', serif;
font-size: 22px;
}
<link href="https://fonts.googleapis.com/css2?family=Alegreya+SC&display=swap" rel="stylesheet">
<div class="left">
<h1>
AAAA
</h1>
</div>