这里的斜线是什么意思:
font: 100%/120%;
最佳答案
这实际上设置了两个属性,相当于:
font-size: 100%;
line-height: 120%;
The syntax of this property is based on a traditional typographical shorthand notation to set multiple properties related to fonts.
正如 David M 在评论中所说,它反射(reflect)了将字体大小指定为“x>pt on y>pt”的排版传统,以表示行高上的字形大小.
但是您问题中的示例实际上是错误的,浏览器会忽略它:您只能在 font
简写符号中组合这两个属性,并且您必须至少指定字体大小和系列。因此,简单地写 font: 100%/120%;
是不够的;您可以添加通用姓氏以使其有效,例如:
font: 100%/120% serif;
关于html - CSS 中带斜线的字体大小,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/701732/