目录
一、边框的形状
![](https://i-blog.csdnimg.cn/blog_migrate/e7214eb8e797d9f661f5af3330b8ba8b.png)
<!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>
.box {
width: 100px;
height: 100px;
/* background-color: transparent; */
border: 50px solid transparent;
/* border-right-color: blue;
border-bottom-color: aqua;
border-left-color: blueviolet; */
/* border-right-color: transparent;
border-bottom-color: transparent;
border-left-color: transparent; */
border-top-color: orange;
box-sizing: border-box;
/* 旋转 */
transform-origin: center 25%;
transform: rotate(180deg);
}
</style>
</head>
<body>
<div class="box"></div>
</body>
</html>
二、认识Web字体
![](https://i-blog.csdnimg.cn/blog_migrate/67c7898b467ea545f939acd6ca05871c.png)
三、Web fonts的工作原理
![](https://i-blog.csdnimg.cn/blog_migrate/eac56dd13b7996325e3ebcea19b39907.png)
四、使用Web Fonts
![](https://i-blog.csdnimg.cn/blog_migrate/26e1c2d42e9b33ec8ab4fa6bba77f203.png)
<!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: "why";
src: url("./fonts/AaQingHuanYuanTi-2.ttf");
}
.box {
font-family: "why";
}
</style>
</head>
<body>
<div class="box">我是div元素</div>
</body>
</html>
五、web-fonts的兼容性
![](https://i-blog.csdnimg.cn/blog_migrate/6e549ffbc83995908cfae733c6db66cd.png)
六、web fonts兼容性写法
![](https://i-blog.csdnimg.cn/blog_migrate/c72374b8acdbeb1f3830767b9a317417.png)
<!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: "why";
src: url("./fonts02/AaQingHuanYuanTi.eot"); /* IE9 */
src: url("./fonts02/AaQingHuanYuanTi.eot?#iefix") format("embedded-opentype"), /* IE6-IE8 */
url("./fonts02/AaQingHuanYuanTi.woff") format("woff"), /* chrome、firefox */
url("./fonts02/AaQingHuanYuanTi.ttf") format("truetype"), /* chrome、firefox、opera、Safari, Android, iOS 4.2+ */
url("./fonts02/AaQingHuanYuanTi.svg#uxfonteditor") format("svg"); /* iOS 4.1- */
font-style: normal;
font-weight: 400;
}
body {
font-family: "why";
}
</style>
</head>
<body>
<div class="box">我是div元素</div>
</body>
</html>
七、认识字体图标
![](https://i-blog.csdnimg.cn/blog_migrate/9d577e384e9149626349cdba33112f3d.png)
八、字体图标的使用
![](https://i-blog.csdnimg.cn/blog_migrate/30d49261d14b6900b2e7aa809e614fd2.png)
<!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: "iconfont";
src: url("./fonts03/iconfont.ttf");
}
.iconfont {
font-family: "iconfont";
font-style: normal;
}
.music::before {
content: "\e664";
}
.icon {
display: inline-block;
width: 20px;
height: 20px;
}
</style>
</head>
<body>
<!-- 直接通过内容(字符实体) -->
<i class="iconfont"></i>
<i class="iconfont"></i>
<i class="icon"></i>
<!-- 不使用字符实体的方式展示出来(伪元素) -->
<i class="iconfont music"></i>
</body>
</html>
iconfont .css
@font-face {
font-family: "iconfont"; /* Project id */
src: url('iconfont.ttf?t=1649043846340') format('truetype');
}
.iconfont {
font-family: "iconfont" !important;
font-size: 16px;
font-style: normal;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.icon-shouye:before {
content: "\e668";
}
.icon-touxiang-kong:before {
content: "\e660";
}
.icon-video:before {
content: "\e63e";
}
.icon-video1:before {
content: "\e624";
}
.icon-music:before {
content: "\e664";
}
.icon-Video:before {
content: "\e69e";
}
.icon-music1:before {
content: "\e654";
}
<!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>
<link rel="stylesheet" href="./fonts03/iconfont.css">
<style>
.icon-shouye {
font-size: 30px;
color: red;
}
</style>
</head>
<body>
<i class="iconfont icon-shouye"></i>
</body>
</html>
九、认识精灵图 CSS Sprite
![](https://i-blog.csdnimg.cn/blog_migrate/6da8b4b11d6b981868c6e3a5b4202933.png)
十、精灵图的使用
![](https://i-blog.csdnimg.cn/blog_migrate/96bdcdfc310773498d6d84beec614c85.png)
<!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>
.box {
background: #333;
}
.topbar {
background-image: url(../images/topbar_sprite.png);
background-repeat: no-repeat;
display: inline-block;
}
i.hot-icon {
background-position: -192px 0;
width: 26px;
height: 13px;
}
i.logo-icon {
background-position: 0 -19px;
width: 157px;
height: 33px;
}
</style>
</head>
<body>
<div class="box">
<i class="topbar hot-icon"></i>
<i class="topbar logo-icon"></i>
<!-- <i class="topbar "></i> -->
</div>
</body>
</html>
十一、cusor
![](https://i-blog.csdnimg.cn/blog_migrate/4354ed896eb0c4eb14e2d47732688b0b.png)
<!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>
div {
cursor: none;
text-decoration: underline;
color: #00f;
}
</style>
</head>
<body>
<div>我是box</div>
<a href="#">百度一下</a>
</body>
</html>