zoukankan      html  css  js  c++  java
  • css使用iconfont

    如果是在标签内加icon----   

    如果是使用class----   <i class='iconfont icon-wrong'></i>

    如果是放在伪元素中使用:

      需要将类名iconfont中的样式拿过来:

            .el-form-item__error::before {
              content: 'e70d'; // &#xe70d;的后四位e70d
              position: absolute;
              top: 7px;
              left: 0;
              font-family: 'iconfont' !important;
              font-size: 16px;
              font-style: normal;
              -webkit-font-smoothing: antialiased;
              -moz-osx-font-smoothing: grayscale;
            }

    svg的使用:

    1、引入iconfont.js文件:

      ①当前文件中引入:import '@static/font/iconfont.js'

      ②main.js中全局引入:import '@static/font/iconfont.js'

    2、css:在当前文件中添加或者在reset.css中添加:

    .svg-icon {
      width: 1em;
      height: 1em;
      vertical-align: -0.15em;
      fill: currentColor;
      overflow: hidden;
    }

    3、html:----icon-kehuguanli:font class

    <svg class="svg-icon" aria-hidden="true">
      <use xlink:href="#icon-kehuguanli" />
    </svg>
  • 相关阅读:
    leetcode-409
    leetcode-836
    leetcode-1160
    leetcode-面试题13
    leetcode-695
    go的一些小lib
    leetcode-300
    cookie
    php上传文件
    PHP 文件创建/写入
  • 原文地址:https://www.cnblogs.com/wuqilang/p/13280216.html
Copyright © 2011-2022 走看看