将段落设置为小型大写字体:
p.normal {font-variant-caps: normal;}
p.small {font-variant-caps: small-caps;}
p.allsmall {font-variant-caps: all-small-caps;}
p.petite {font-variant-caps: petite-caps;}
p.allpetite {font-variant-caps: all-petite-caps;}
p.unicase {font-variant-caps: unicase;}
p.titling {font-variant-caps: titling-caps;}
亲自试一试 »
这个font-variant-caps
属性控制大写字母替代字形的使用。
默认值: | 普通的 |
---|---|
遗传: | 是的 |
可动画: | 不。阅读可动画的 |
版本: | CSS3 |
JavaScript 语法: | 对象.style.fontVariantCaps="small-caps" |
表中的数字指定完全支持该属性的第一个浏览器版本。
Property | |||||
---|---|---|---|---|---|
font-variant-caps | 52.0 | 79.0 | 34.0 | Not supported | 39.0 |
font-variant-caps: normal|small-caps|all-small-caps|petite-caps|all-petite-caps|unicase|titling-caps|initial|inherit|unset;
Value | Description | Demo |
---|---|---|
normal | Deactivates the use of alternate glyphs | Demo ❯ |
small-caps | Displays small capitals | Demo ❯ |
all-small-caps | Displays small capitals for both upper and lowercase letters | Demo ❯ |
petite-caps | Displays petite capitals | Demo ❯ |
all-petite-caps | Displays petite capitals for both upper and lowercase letters | Demo ❯ |
unicase | Displays a mix of small capitals for uppercase letters with normal lowercase letters | Demo ❯ |
titling-caps | Displays titling capitals | Demo ❯ |
initial | Sets this property to its default value. Read about initial | |
inherit | Inherits this property from its parent element. Read about inherit | |
unset |
CSS教程:CSS 字体
CSS 参考:字体属性
HTML DOM 参考:fontVariant 属性
截取页面反馈部分,让我们更快修复内容!也可以直接跳过填写反馈内容!