คุณสมบัติการแปลงข้อความ CSS
ตัวอย่าง
แปลงข้อความในองค์ประกอบ <div> ที่แตกต่างกัน:
div.a {
text-transform: uppercase;
}
div.b {
text-transform: lowercase;
}
div.c {
text-transform: capitalize;
}
ความหมายและการใช้งาน
คุณสมบัติควบคุม การtext-transform
ใช้อักษรตัวพิมพ์ใหญ่ของข้อความ
ค่าเริ่มต้น: | ไม่มี |
---|---|
รับการถ่ายทอด: | ใช่ |
รุ่น: | CSS1 |
ไวยากรณ์ JavaScript: | วัตถุ .style.textTransform = "ตัวพิมพ์ใหญ่" |
รองรับเบราว์เซอร์
ตัวเลขในตารางระบุเบราว์เซอร์รุ่นแรกที่สนับสนุนคุณสมบัติอย่างสมบูรณ์
Property | |||||
---|---|---|---|---|---|
text-transform | 1.0 | 4.0 | 1.0 | 1.0 | 7.0 |
ไวยากรณ์ CSS
text-transform: none|capitalize|uppercase|lowercase|initial|inherit;
มูลค่าทรัพย์สิน
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 |
หน้าที่เกี่ยวข้อง
กวดวิชา CSS: CSS Text
การอ้างอิง HTML DOM: textTransform property