标准实例
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Sofia">
<style>
body {
font-family: "Sofia";
font-size: 22px;
}
</style>
</head>
<body>
<h1>Sofia Font</h1>
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.</p>
</body>
</html>
HTML 引用方式
HTML 引用字体文件
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Georgia">
CSS 应用字体样式
.myFont {
font-family: Georgia, sans-serif;
}
CSS 引入方式
@IMPORT
@import url("https://fonts.googleapis.com/css?family=Poppins:100,200,300,400,500,600,700,800,900");
body {
font-family: Poppins, sans-serif;
}
0 条评论