📅  最后修改于: 2020-11-04 05:58:47             🧑  作者: Mango
CSS中的font-stretch属性允许我们从字体家族中选择正常,扩展或压缩的外观。与字体的默认宽度相比,此属性将文本设置为更宽或更窄。它不适用于任何字体,而仅适用于具有宽变脸的字体系列。
此CSS属性仅适用于具有其他面孔的字体,例如扩展和压缩的面孔;否则,对于没有缩略或扩展的字体的字体来说,这将是无效的。
以下语法提供了九个用于选择字体宽度的关键字值。
font-stretch: normal | semi-condensed | condensed | extra-condensed | ultra-condensed | semi-expanded | expanded | extra-expanded | ultra-expanded
此CSS属性的属性值列表如下:
Keyword | Description |
---|---|
normal | This is the default value, which does not stretch any font. |
semi-condensed | It slightly condensed the text characters of the element. This value makes the text narrower than normal but not narrower than condensed. |
condensed | This value makes the text narrower than semi-condensed but not narrower than extra-condensed. |
extra-condensed | This value makes the text narrower than condensed but not narrower than ultra-condensed. |
ultra-condensed | This value makes the text extremely narrowed. |
semi-expanded | It slightly widened the text characters of the element. This value makes the text wider than normal but not wider than expanded. |
expanded | This value makes the text wider than semi-expanded but not wider than extra-expanded. |
extra-expanded | This value makes the text wider than expanded but not wider than ultra-expanded. |
ultra-expanded | This value makes the text extremely wider. |
让我们通过一个示例来了解上述属性值。
CSS font-stretch Property
Example of the font-stretch property
normal
semi-condensed
condensed
extra-condensed
ultra-condensed
输出量