好吧,我对字体元素有问题。它在 chrome 中运行良好,但不适用于任何浏览器。问题出在哪里?提前谢谢。
演示 -> http://codepen.io/designhorf/pen/AlJKp
不仅仅是一个 otf 文件。不同的浏览器需要不同的文件类型,而IE像往常一样没有行为。
@font-face{
font-family: 'YourFont';
src: url('../fonts/YourFont.eot');
src: url('../fonts/YourFont.eot?#iefix') format('embedded-opentype'),
url('../fonts/YourFont.woff') format('woff'),
url('../fonts/YourFont.ttf') format('truetype'),
url('../fonts/YourFont.svg#webfont') format('svg');
font-weight: normal;
font-style: normal;
}
生成代码和文件的一个很好的资源是http://www.fontsquirrel.com/tools/webfont-generator
玩得愉快!