Thuộc tính chuyển đổi văn bản CSS
Thí dụ
Chuyển đổi văn bản trong các phần tử <div> khác nhau:
div.a {
text-transform: uppercase;
}
div.b {
text-transform: lowercase;
}
div.c {
text-transform: capitalize;
}
Định nghĩa và Cách sử dụng
Thuộc text-transform
tính kiểm soát cách viết hoa của văn bản.
Giá trị mặc định: | không ai |
---|---|
Thừa hưởng: | Đúng |
Phiên bản: | CSS1 |
Cú pháp JavaScript: | đối tượng .style.textTransform = "chữ hoa" |
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 | |||||
---|---|---|---|---|---|
text-transform | 1.0 | 4.0 | 1.0 | 1.0 | 7.0 |
Cú pháp CSS
text-transform: none|capitalize|uppercase|lowercase|initial|inherit;
Giá trị tài sản
Value | Description | Play it |
---|---|---|
none | No capitalization. The text renders as it is. This is default | |
capitalize | Transforms the first character of each word to uppercase | |
uppercase | Transforms all characters to uppercase | |
lowercase | Transforms all characters to lowercase | |
initial | Sets this property to its default value. Read about initial | |
inherit | Inherits this property from its parent element. Read about inherit |
Các trang liên quan
Hướng dẫn CSS: Văn bản CSS
Tham chiếu DOM HTML: thuộc tính textTransform