HTML <del>แท็ก
ตัวอย่าง
ข้อความที่มีส่วนที่ถูกลบและส่วนที่แทรกใหม่:
<p>My favorite color is <del>blue</del> <ins>red</ins>!</p>
ตัวอย่าง "ลองใช้เอง" เพิ่มเติมด้านล่าง
ความหมายและการใช้งาน
แท็ ก<del>
กำหนดข้อความที่ถูกลบออกจากเอกสาร เบราว์เซอร์มักจะขีดเส้นผ่านข้อความที่ถูกลบ
เคล็ดลับและหมายเหตุ
เคล็ดลับ:ดูที่ แท็ก <ins>เพื่อมาร์กอัปข้อความที่แทรก
รองรับเบราว์เซอร์
Element | |||||
---|---|---|---|---|---|
<del> | Yes | Yes | Yes | Yes | Yes |
คุณลักษณะ
Attribute | Value | Description |
---|---|---|
cite | URL | Specifies a URL to a document that explains the reason why the text was deleted/changed |
datetime | YYYY-MM-DDThh:mm:ssTZD | Specifies the date and time of when the text was deleted/changed |
คุณสมบัติสากล
แท็ ก<del>
ยังสนับสนุน Global Attributes ในHTML
คุณสมบัติของเหตุการณ์
แท็ ก<del>
ยังสนับสนุนแอตทริบิวต์เหตุการณ์ใน HTML
ตัวอย่างเพิ่มเติม
ตัวอย่าง
ใช้ CSS เพื่อจัดรูปแบบ <del> และ <ins>:
<html>
<head>
<style>
del {background-color:
tomato;}
ins {background-color: yellow;}
</style>
</head>
<body>
<p>My favorite color is <del>blue</del> <ins>red</ins>!</p>
</body>
</html>
หน้าที่เกี่ยวข้อง
การอ้างอิง HTML DOM: Del Object
การตั้งค่า CSS เริ่มต้น
เบราว์เซอร์ส่วนใหญ่จะแสดง<del>
องค์ประกอบด้วยค่าเริ่มต้นดังต่อไปนี้:
ตัวอย่าง
del {
text-decoration: line-through;
}