สไตล์textDecorationLine Property
ตัวอย่าง
แสดงองค์ประกอบที่มีเส้นผ่านข้อความ:
document.getElementById("demo").style.textDecorationLine = "line-through";
ความหมายและการใช้งาน
คุณสมบัติ textDecorationLine ตั้งค่าหรือส่งคืนชนิดของบรรทัด หากมี การตกแต่งจะมี
หมายเหตุ:คุณยังสามารถตั้งค่า textDecorationLine โดยใช้คุณสมบัติ textDecoration ซึ่งเป็นคุณสมบัติแบบสั้นสำหรับคุณสมบัติ textDecorationLine, textDecorationStyle และ textDecorationColor
หมายเหตุ:คุณยังสามารถรวมค่าได้มากกว่าหนึ่งค่า เช่น ขีดเส้นใต้และ ขีดเส้นใต้ เพื่อแสดงบรรทัดทั้งข้างใต้และเหนือข้อความ
รองรับเบราว์เซอร์
Property | |||||
---|---|---|---|---|---|
textDecorationLine | 57.0 | 79.0 | 36.0 6.0 Moz |
7.0 Webkit | 44.0 |
ไวยากรณ์
ส่งคืนคุณสมบัติ textDecorationLine:
object.style.textDecorationLine
ตั้งค่าคุณสมบัติ textDecorationLine:
object.style.textDecorationLine = "none|underline|overline|line-through|initial|inherit"
มูลค่าทรัพย์สิน
Value | Description |
---|---|
none | Default value. Specifies no line for the text-decoration |
underline | Specifies that a line will be displayed under the text |
overline | Specifies that a line will be displayed over the text |
line-through | Specifies that a line will be displayed 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 |
รายละเอียดทางเทคนิค
ค่าเริ่มต้น: | ไม่มี |
---|---|
คืนมูลค่า: | สตริงที่แสดงถึงคุณสมบัติ text-decoration-line ของ element |
เวอร์ชัน CSS | CSS3 |
หน้าที่เกี่ยวข้อง
การอ้างอิง CSS: คุณสมบัติ text-decoration-line
❮ สไตล์วัตถุ