在線字體

1.找到須要添加字體的文字,而後打開iconfont,https://www.iconfont.cn/webfont?spm=a313x.7781068.0.d81ec59f2#!/webfont/indexhtml

把文字複製進去,點擊下載在線字體,而後把下載的文件放到項目中,最後引用就行web

 

 

 

 

    @font-face {
      font-family: "webfont";
      font-display: swap;
      src: url('../font/webfont.eot'); /* IE9 */
      src: url('../font/webfont.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
      url('../font/webfont.woff2') format('woff2'),
      url('../font/webfont.woff') format('woff'), /* chrome、firefox */
      url('../font/webfont.ttf') format('truetype'), /* chrome、firefox、opera、Safari, Android, iOS 4.2+*/
      url('../font/webfont.svg#webfont') format('svg'); /* iOS 4.1- */
    }
    .web-font {
      font-family: "webfont" !important;
      font-size: 16px;
      font-style: normal;
      -webkit-font-smoothing: antialiased;
      -moz-osx-font-smoothing: grayscale;
    }
<p class="web-font">在線字體的樣式,能夠經過網絡下載,在新的環境中</p>

  先定義字體,而後再標籤中引用。注意:文件路徑chrome

相關文章
相關標籤/搜索