在所有体面的网络浏览器中,@font-face 仅用于将外部字体加载到您的网页中。但是,对于早于 IE9 的 IE 版本,这不起作用。我想使用 Ubuntu 字体系列。 有什么好主意吗?
最佳答案
FontSquirrel将为您创建合适的跨浏览器 CSS。
示例 CSS:
@font-face {
font-family: 'DroidSansRegular';
src: url('/resources/fonts/DroidSans-webfont.eot');
src: url('/resources/fonts/DroidSans-webfont.eot?#iefix') format('embedded-opentype'),
url('/resources/fonts/DroidSans-webfont.woff') format('woff'),
url('/resources/fonts/DroidSans-webfont.ttf') format('truetype'),
url('/resources/fonts/DroidSans-webfont.svg#DroidSansRegular') format('svg');
font-weight: normal;
font-style: normal;
}
这适用于 IE7 及更高版本,当然也适用于所有其他浏览器。
关于html - 在网页中加载外部字体。 Internet Explorer 的解决方案?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6996349/