栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 面试经验 > 面试问答

多个字体权重,一个@ font-face查询

面试问答 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

多个字体权重,一个@ font-face查询

实际上,@ font-face有一种特殊的风味,可以满足您的要求。

这是一个示例,该示例使用相同的字体系列名称,并且具有与不同字体相关联的不同样式和粗细:

@font-face {  font-family: "DroidSerif";  src: url("DroidSerif-Regular-webfont.ttf") format("truetype");  font-weight: normal;  font-style: normal;}@font-face {  font-family: "DroidSerif";  src: url("DroidSerif-Italic-webfont.ttf") format("truetype");  font-weight: normal;  font-style: italic;}@font-face {  font-family: "DroidSerif";  src: url("DroidSerif-Bold-webfont.ttf") format("truetype");  font-weight: bold;  font-style: normal;}@font-face {  font-family: "DroidSerif";  src: url("DroidSerif-BoldItalic-webfont.ttf") format("truetype");  font-weight: bold;  font-style: italic;}

现在,您可以指定

font-weight:bold
font-style:italic
对所需的任何元素进行指定,而不必指定font-
family或覆盖
font-weight
and
font-style

body { font-family:"DroidSerif", Georgia, serif; }h1 { font-weight:bold; }em { font-style:italic; }strong em {  font-weight:bold;  font-style:italic;}

有关此功能和标准用法的完整概述,请参阅本文。


示例笔



转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/635487.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号