最近一个客户需要使用苹果官网的苹方字体,这里面要涉及到css字体的使用
<style> @font-face { font-family: "PingFang Regular"; src: url("http://www.seedpodeco.cn/statics/fonts/fonts/PingFang Regular/PingFang Regular.eot"); /* IE9 */ src: url("http://www.seedpodeco.cn/statics/fonts/fonts/PingFang Regular/PingFang Regular.eot?#iefix") format("embedded-opentype"), /* IE6-IE8 */ url("http://www.seedpodeco.cn/statics/fonts/fonts/PingFang Regular/PingFang Regular.woff") format("woff"), /* chrome、firefox */ url("http://www.seedpodeco.cn/statics/fonts/fonts/PingFang Regular/PingFang Regular.ttf") format("truetype"), /* chrome、firefox、opera、Safari, Android, iOS 4.2+ */ url("http://www.seedpodeco.cn/statics/fonts/fonts/PingFang Regular/PingFang Regular.svg#PingFang Regular") format("svg"); /* iOS 4.1- */ font-style: normal; font-weight: normal; } @font-face { font-family: "PingFang Medium"; src: url("http://www.seedpodeco.cn/statics/fonts/fonts/PingFang Medium/PingFang Medium.eot"); /* IE9 */ src: url("http://www.seedpodeco.cn/statics/fonts/fonts/PingFang Medium/PingFang Medium.eot?#iefix") format("embedded-opentype"), /* IE6-IE8 */ url("http://www.seedpodeco.cn/statics/fonts/fonts/PingFang Medium/PingFang Medium.woff") format("woff"), /* chrome、firefox */ url("http://www.seedpodeco.cn/statics/fonts/fonts/PingFang Medium/PingFang Medium.ttf") format("truetype"), /* chrome、firefox、opera、Safari, Android, iOS 4.2+ */ url("http://www.seedpodeco.cn/statics/fonts/fonts/PingFang Medium/PingFang Medium.svg#PingFang Medium") format("svg"); /* iOS 4.1- */ font-style: normal; font-weight: normal; } </style> <h1 style="font-family: PingFang Medium, sans-serif;">硬表面清洁</h1>
这样就可以扩展到其他字体的使用了,有个麻烦的就是需要下载对应的字体,当然也可以使用web字体