<style> @font-face{font-family:myfirstfont;src:url ('sansation_ Light.ttf'), url ('sansation_light.eot'/* */}div{font-family:myfirstfont;} </style>
Different browser fonts are formatted differently
Firefox, Chrome, Safari, and Opera support. TTF (True type Fonts) and. OTF (OpenType Fonts) types of fonts.
Internet Explorer + + supports the new @font-face rules, but only the. EoT type of font (Embedded OpenType) is supported.
Note: Internet Explorer 8 and earlier versions do not support the new @font-face rules.
.TTF或.OTF,适用于Firefox 3.5、Safari、Opera * .EOT,适用于Internet Explorer 4.0+ * .SVG,适用于Chrome、IPhone 比如:
@font-Face {font-family:'Hanshanditalic'; Src:url ('Fonts/hanshand-webfont.eot'); Src:url ('fonts/hanshand-webfont.eot? #iefix') Format ('Embedded-opentype'), url ('Fonts/hanshand-webfont.woff') Format ('Woff'), url ('Fonts/hanshand-webfont.ttf') Format ('TrueType'), url ('fonts/hanshand-webfont.svg#webfont34m5alkg') Format ('svg'); Font-Weight:normal; Font-Style:normal;}
CSS introduces external fonts