font-face使用自己的字体

版权声明:本文为博主原创文章,未经博主允许不可转载。转载请注明出处 https://blog.csdn.net/qq_32442967/article/details/84784083

@font-face使用自己的字体

找到希望使用的字体,可将该字体文件存放到 web 服务器上,它会在需要时被自动下载到用户的计算机上。
您“自己的”的字体是在 CSS3 @font-face 规则中定义的。


浏览器支持: Firefox、Chrome、Safari 以及 Opera 支持 .ttf (True Type Fonts) 和 .otf (OpenType Fonts) 类型的字体。 Internet Explorer 9+ 支持新的 @font-face 规则,但是仅支持 .eot 类型的字体 (Embedded OpenType)。 注释:Internet Explorer 8 以及更早的版本不支持新的 @font-face 规则。
定义字体:
@font-face {
	font-family:FRANCO;		/*自定义字体名称*/
	src:url(fonts/FRANCO.eot) format("embedded-opentype"); 	/*ie 6+ */
		url(fonts/FRANCO.TTF) format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.3+*/;
	font-weight: normal;
  	font-style: normal;
}

使用字体:

.font-f{
	font-family: FRANCO;
}

如果只有一种字体文件,可以在线生成字体,下面链接是我自己使用过的。
在线生成字体


猜你喜欢

转载自blog.csdn.net/qq_32442967/article/details/84784083