scss @mixin定义的@font-face怎么使用啊

@mixin font-face($font-family, $file-path, $weight: normal, $style: normal ) {
 @font-face {
   font-family: $font-family;
   font-weight: $weight;
   font-style: $style;
   src: url('#{$file-path}.eot'); // 1
   src: url('#{$file-path}.eot?#iefix')               format('eot'), // 2
        url('#{$file-path}.svg##{$font-family}')      format('svg'), // 3
        url('#{$file-path}.woff')                     format('woff'), // 4
        url('#{$file-path}.ttf')                      format('truetype'); //5
 }
}

比如这种,定义的是css3的字体文件。

我想在div的font-family里面使用自己定义的字体要怎么使用

例如:

div{

font-family: @include font-face();  //然后括号里面传参数?

}

猪名已被占用
浏览 2113回答 0
0回答
打开App,查看更多内容
随时随地看视频慕课网APP