CSS字体图标和CSS三角

字体图标的下载

http://icomoon.io

字体图标的使用

  1. 把下载包里面的fonts 文件夹放入页面根目录下
  2. 在CSS样式中全局声明字体 : 简单理解把这些字体文件通过css引入到我们页面中
  3. html标签内添加小图标
  4. 给标签声明字体
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        @font-face {
            font-family: 'icomoon';
            src: url('fonts/icomoon.eot?p4ssmb');
            src: url('fonts/icomoon.eot?p4ssmb#iefix') format('embedded-opentype'), url('fonts/icomoon.ttf?p4ssmb') format('truetype'), url('fonts/icomoon.woff?p4ssmb') format('woff'), url('fonts/icomoon.svg?p4ssmb#icomoon') format('svg');
            font-weight: normal;
            font-style: normal;
            font-display: block;
        }
        
        span {
            font-family: 'icomoon';
            font-size: 100px;
            color: blue;
        }
    </style>

</head>

<body>
    <span></span>
</body>

</html>

字体图标的追加

在这里插入图片描述

CSS三角

给一个盒子设置高度和宽度都是0, 再给每个边框不同的颜色
在这里插入图片描述
所以三角形就是给三个边一个透明边框, 给另外一个边框设置一个实线边框, 就是一个三角形

CSS三角实例

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .jd {
            position: relative;
            width: 120px;
            height: 250px;
            margin: 60px auto;
            background-color: pink;
        }
        
        .jd span {
            position: absolute;
            top: -10px;
            right: 20px;
            width: 0px;
            height: 0px;
            border: 5px solid transparent;
            border-bottom-color: pink;
        }
    </style>
</head>

<body>
    <div class="jd">
        <span></span>
    </div>
</body>

</html>
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值