สไตล์ข้อความคุณสมบัติการ ตกแต่ง
ตัวอย่าง
ตั้งค่าการตกแต่งข้อความสำหรับองค์ประกอบ:
document.getElementById("demo").style.textDecoration = "underline overline";
ความหมายและการใช้งาน
คุณสมบัติ textDecoration ตั้งค่าหรือส่งคืนการตกแต่งมากกว่าหนึ่งรายการสำหรับข้อความ
เคล็ดลับ:หากต้องการระบุประเภทการตกแต่งมากกว่าหนึ่งประเภทสำหรับองค์ประกอบ ให้ระบุรายการประเภทการตกแต่งที่คั่นช่องว่าง
รองรับเบราว์เซอร์
Property | |||||
---|---|---|---|---|---|
textDecoration | Yes | Yes | Yes | Yes | Yes |
ไวยากรณ์
ส่งคืนคุณสมบัติ textDecoration:
object.style.textDecoration
ตั้งค่าคุณสมบัติ textDecoration:
object.style.textDecoration = "none|underline|overline|line-through|blink|initial|inherit"
มูลค่าทรัพย์สิน
Value | Description |
---|---|
none | Defines a normal text. This is default |
underline | Defines a line under the text |
overline | Defines a line over the text |
line-through | Defines a line through the text |
initial | Sets this property to its default value. Read about initial |
inherit | Inherits this property from its parent element. Read about inherit |
รายละเอียดทางเทคนิค
ค่าเริ่มต้น: | ไม่มี |
---|---|
คืนมูลค่า: | สตริงที่แสดงถึงการตกแต่งที่เพิ่มให้กับข้อความ |
เวอร์ชัน CSS | CSS1 |
ตัวอย่างเพิ่มเติม
ตัวอย่าง
ส่งคืนการตกแต่งข้อความขององค์ประกอบ:
alert(document.getElementById("demo").style.textDecoration);
หน้าที่เกี่ยวข้อง
กวดวิชา CSS: CSS Text
การอ้างอิง CSS: คุณสมบัติการตกแต่งข้อความ
❮ สไตล์วัตถุ