Properti transformasi teks CSS
Contoh
Ubah teks dalam elemen <div> yang berbeda:
div.a {
text-transform: uppercase;
}
div.b {
text-transform: lowercase;
}
div.c {
text-transform: capitalize;
}
Definisi dan Penggunaan
Properti text-transform
mengontrol kapitalisasi teks.
Nilai bawaan: | tidak ada |
---|---|
Diwarisi: | Ya |
Versi: kapan: | CSS1 |
Sintaks JavaScript: | objek .style.textTransform="huruf besar" |
Dukungan Peramban
Angka-angka dalam tabel menentukan versi browser pertama yang sepenuhnya mendukung properti.
Property | |||||
---|---|---|---|---|---|
text-transform | 1.0 | 4.0 | 1.0 | 1.0 | 7.0 |
Sintaks CSS
text-transform: none|capitalize|uppercase|lowercase|initial|inherit;
Nilai properti
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 |
Halaman Terkait
Tutorial CSS: Teks CSS
Referensi HTML DOM: properti textTransform