使用font-face改变字体即加载外部字体

内容摘要
复制代码代码如下:
<!DOCTYPE HTML>
<meta charset="UTF-8">
<head>
<script src="jquery-1.8.2.min.js"></script>
<style>
#gmap,#controls {
width:300px;
heig
文章正文

复制代码
代码如下:

<!DOCTYPE HTML>
<meta charset="UTF-8">
<head>
<script src="jquery-1.8.2.min.js"></script>
<style>
#gmap,#controls {
width:300px;
height:300px;
}
@font-face {
font-family: Lovelo-Black;/×定义font的名字×/
src: url('font/Lovelo Black.otf');/*把下载的字体文件引入进来×/
}
@font-face {
font-family: Lovelo;
src: url('font/Lovelo Line Bold.otf');
}
@font-face {
font-family: HYPED;
src: url('font/HYPED_Font.otf');
}
div.a {
font-family: Lovelo-Black, sans-serif;
font-size:24px;
}
div.b {
font-family: Lovelo, sans-serif;
font-size:24px;
}
div.c {
font-family: HYPED, sans-serif;
font-size:24px;
color:yellow;
}
body {
background-color:rgb(216, 216, 216);
}
</style>
<script>
</script>
</head>
<body class="sapUiBody">
<div class="a">Hello World 123456</div>
<div class="b">Hello World 123456</div>
<div class="c">Hello World 123456</div>
</body>

代码注释

作者:喵哥笔记

IDC笔记

学的不仅是技术,更是梦想!