html - 如何在网站上实现字体
问题描述
有人可以告诉我在我的 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; }
解决方案
你可以像这样简单地使用它:
@font-face {
font-family: Burbank.otf ;
src: "url from the font"
}
your cla{
font-family: Burbank.otf;
}
我希望这将有所帮助 。
推荐阅读
- python - Python BeautifulSoup 网页抓取
- apache-spark - Spark - hiding errors by nulling values?
- php - 如何修复:解析错误:语法错误,意外的“||” (T_BOOLEAN_OR)
- javascript - Twilio 消息响应返回为未定义的节点
- ios - MPVolumeView 在显示 AVPlayerViewController 后不抑制默认系统音量 UI
- swiftui - 添加手势后SwiftUI TextField不起作用
- python - 规范化 numpy ndArray
- java - Java Swing 验证问题 - “此处应有接口”
- javascript - 使用 ReactJS 下新订单时如何播放声音
- r - fread 没有正确读取列名