我想知道我是否可以在我的 CSS 中为相同的字体(文件)定义多个 font-family
名称。
@font-face {
font-family: 'Cool font';
src: url('bumblebee-webfont.eot');
src: local('☺'),
url('bumblebee-webfont.woff') format('woff'),
url('bumblebee-webfont.ttf') format('truetype'),
url('bumblebee-webfont.svg#webfontg8dbVmxj') format('svg');
}
@font-face {
font-family: 'New font';
src: url('bumblebee-webfont.eot');
src: local('☺'),
url('bumblebee-webfont.woff') format('woff'),
url('bumblebee-webfont.ttf') format('truetype'),
url('bumblebee-webfont.svg#webfontg8dbVmxj') format('svg');
}
我喜欢这个,因为同一种字体有多种名称用法。应该是下面的文字有相同的字体:
<h2 style="font-family:'Cool font';">Hello</h2>
<h2 style="font-family:'New font';">Bye</h2>
这可能吗?
最佳答案
是的,你可以做到这一点。
因为font-family
是key,可以设置很多font face
,名字不同,Font
相同,但并不常见以这种方式使用它!!
关于html - 我可以为同一字体定义多个字体系列名称吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38955273/