css3 之 @font-face 使用

@font-face  使用

    语法:

 

 @font-face {
      font-family: <YourWebFontName>;
      src: <source> [<format>][,<source> [<format>]]*;
      [font-weight: <weight>];
      [font-style: <style>];
    }

    解释:

  1.  YourWebFontName:此值指的就是你自定义的字体名称,最好是使用你下载的默认字体,他将被引用到你的Web元素中的font-family。如“font-family:"YourWebFontName";”
  2. source:此值指的是你自定义的字体的存放路径,可以是相对路径也可以是绝路径;
  3. format:此值指的是你自定义的字体的格式,主要用来帮助浏览器识别,其值主要有以下几种类型:truetype,opentype,truetype-aat,embedded-opentype,avg等;
  4. weight和style:这两个值大家一定很熟悉,weight定义字体是否为粗体,style主要定义字体样式,如斜体。 

猜你喜欢

转载自lgclove1314.iteye.com/blog/2312126