【发布时间】:2017-01-29 03:15:15
【问题描述】:
我希望了解在这样的网站中嵌入字体有什么区别:
@font-face {
font-family: 'Kulturista Medium';
src: url('fonts/Kulturista Medium.eot');
src: local('☺'), url('fonts/Kulturista Medium.woff') format('woff'), url('fonts/Kulturista Medium.ttf') format('truetype'), url('fonts/Kulturista Medium.svg') format('svg');
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: 'Kulturista Semibold';
src: url('fonts/Kulturista Semibold.eot');
src: local('☺'), url('fonts/Kulturista Semibold.woff') format('woff'), url('fonts/Kulturista Semibold.ttf') format('truetype'), url('fonts/Kulturista Semibold.svg') format('svg');
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: 'Kulturista Semibold Italic';
src: url('fonts/Kulturista Semibold Italic.eot');
src: local('☺'), url('fonts/Kulturista Semibold Italic.woff') format('woff'), url('fonts/Kulturista Semibold Italic.ttf') format('truetype'), url('fonts/Kulturista Semibold Italic.svg') format('svg');
font-weight: normal;
font-style: normal;
}
对比像这样只加载一种字体
@font-face {
font-family: 'Kulturista';
src: url('fonts/Kulturista.eot');
src: local('☺'), url('fonts/Kulturista.woff') format('woff'), url('fonts/Kulturista.ttf') format('truetype'), url('fonts/Kulturista Medium.svg') format('svg');
font-weight: normal;
font-style: normal;
}
和 CSS 样式
body {
font-family: 'Kulturista', Fallback, sans-serif;
font-style: italic;
font-weight: bold;
}
我想这是有好处的,否则您不会想要加载更多资源。
【问题讨论】:
标签: css fonts font-face webfonts