Thuộc tính font-variant-caps của CSS
Ví dụ
Đặt đoạn văn thành phông chữ viết hoa nhỏ:
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;}
Hãy tự mình thử »Định nghĩa và cách sử dụng
Thuộc tính font-variant-caps
kiểm soát việc sử dụng các ký tự thay thế cho chữ in hoa.
Giá trị mặc định: | Bình thường |
---|---|
Thừa hưởng: | Đúng |
Hoạt hình: | KHÔNG. Đọc về hoạt hình |
Phiên bản: | CSS3 |
Cú pháp JavaScript: | đối tượng .style.fontVariantCaps="small-caps" |
Hỗ trợ trình duyệt
Các số trong bảng chỉ định phiên bản trình duyệt đầu tiên hỗ trợ đầy đủ thuộc tính.
Property | |||||
---|---|---|---|---|---|
font-variant-caps | 52.0 | 79.0 | 34.0 | Not supported | 39.0 |
Cú pháp CSS
font-variant-caps: normal|small-caps|all-small-caps|petite-caps|all-petite-caps|unicase|titling-caps|initial|inherit|unset;
Giá trị tài sản
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 |
Trang liên quan
Hướng dẫn CSS: Phông chữ CSS
Tham chiếu CSS: thuộc tính phông chữ
Tham chiếu DOM HTML: thuộc tính fontVariant