首页 > 解决方案 > 如何在网站上实现字体

问题描述

有人可以告诉我在我的 css 文件中放入什么来安装名为“Burbank.otf”的字体以及在 html 中放入什么来制作该字体中的文本

我在 HTML 中有这个:

<!DOCTYPE HTML>
<html>
<head>
<link rel="stylesheet" type="text/css" href="mystyle.css">
   <body>
      <h1>Hey, June</h1>
   </body>
</head>
</html>
<html>

<head>
  <title>Test</title>
</head>

这在 CSS 中:

@font-face { font-family: Junebug; src: url('Burbank.otf'); } 
.junebug { font-family: Junebug; font-size: 4.2em; }

标签: htmlcssfonts

解决方案


你可以像这样简单地使用它:

@font-face {
  font-family: Burbank.otf ;
  src: "url from the font"
}

your cla{
  font-family: Burbank.otf;
}

我希望这将有所帮助 。


推荐阅读