1. 服务器字体
@font-face
@font-face{ font-family:自定义名称;src:字体源}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
@font-face{
font-family: 'tu';
src: url('QianTuXiaoTuTi/QianTuXiaoTuTi-2.ttf');
}
p{
font-family: 'tu';
font-size: 2rem;
}
</style>
</head>
<body>
<p>
明月别枝惊鹊,清风半夜鸣蝉。稻花香里说丰年,听取蛙声一片。
七八个星天外,两三点雨山前。旧时茅店社林边,路转溪桥忽见。
</p>
</body>
</html>
2. 阿里巴巴矢量库
1.在网页中搜索电影,出现图标,点击添加入库
2.点击购物车,下载代码,得到压缩包
3.解压文件,找到demo_index.html打开,得到使用教程
仿卖座底部导航栏:
第一种方式:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>仿卖座底部导航栏</title>
<style>
@font-face {
font-family: 'iconfont';
src: url('download/iconfont.ttf?t=1628749907478') format('truetype');
}
*{
padding: 0;
margin: 0;
list-style: none;
box-sizing: border-box;
}
body{
background-color: #ccc;
}
nav {
width: 100%;
height: 60px;
background-color: white;
border: 1px solid gray;
position: fixed;
bottom: 0;
}
ul {
height: 100%;
display: flex;
justify-content: space-around;
}
li {
text-align: center;
}
li p:nth-of-type(1) {
font-family: 'iconfont';
font-size: 25px;
margin-top: 5px;
}
li:nth-of-type(1){
color: red;
}
</style>
</head>
<body>
<nav>
<ul>
<li>
<p></p>
<p>电影</p>
</li>
<li>
<p></p>
<p>影院</p>
</li>
<li>
<p></p>
<p>资讯</p>
</li>
<li>
<p></p>
<p>我的</p>
</li>
</ul>
</nav>
</body>
</html>
第二种方式
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>仿卖座底部导航栏</title>
<link rel="stylesheet" href="download/iconfont.css">
<style>
*{
padding: 0;
margin: 0;
list-style: none;
box-sizing: border-box;
}
body{
background-color: #ccc;
}
nav {
width: 100%;
height: 60px;
background-color: white;
border: 1px solid gray;
position: fixed;
bottom: 0;
}
ul {
height: 100%;
display: flex;
justify-content: space-around;
}
li {
text-align: center;
}
li p:nth-of-type(1) {
font-family: 'iconfont';
font-size: 25px;
margin-top: 5px;
}
li:nth-of-type(1){
color: red;
}
</style>
</head>
<body>
<nav>
<ul>
<li>
<p class="iconfont icon-dianying"></p>
<p>电影</p>
</li>
<li>
<p class="iconfont icon-yingyuan"></p>
<p>影院</p>
</li>
<li>
<p class="iconfont icon-xiaoxiicon"></p>
<p>资讯</p>
</li>
<li>
<p class="iconfont icon-tubiao-"></p>
<p>我的</p>
</li>
</ul>
</nav>
</body>
</html>