In HTML, the del tag stands for delete , and it is used to mark a portion of text which has been deleted from the document. The browsers display the text found within the del tag as a strike-through text. You can change this property by using the CSS text-decoration property.
Tips : You can use the tag to indicate the deleted text with HTML del tag.
The presence of the del tag is not announced by most screen reading technology. It can be announced by using the CSS content property along with the “::before“ and “::after“ pseudo-elements.
Estimated reading time: 2 minutes
Syntax:
The del tag contains both an opening del tag and closing del tag. The content is written between these two tags.
<del>Write your text here </del>
HTML del Tag:
| HTML del tag | Markup the deleted text |
| Content categories | Phrasing content, flow content |
| Permitted content | Transparent |
| Tag omission | None, both opening and closing tags are mandatory. |
| Permitted parents | Any HTML element that accepts phrasing content. |
| Implicit ARIA role | No corresponding role |
| Permitted ARIA roles | Any |
| DOM interface | HTMLModElement |
Sample of the HTML del Tag:
Here is the simple example for HTML delete tag.
<!DOCTYPE html>
<html>
<head>
<title>Title of the document</title>
</head>
<body>
<h3>Example for Delete tag:</h3>
<p><b>What is your favorite sports?</b></p>
<p>My favorite sports is <del>Hockey</del> <ins style="color:#C40655;"> Cricket</ins>!</p>
</body>
</html>
Info : For displaying the text us underline, you can use the CSS text-decoration property with the “line-through” value.
Result:
Download Sample File:
Attributes:
The del tag supports both the Global Attributes and the Event Attributes.
Attribute | value | Description |
---|---|---|
cite | URL | It will specify the URL of the document , which explains why the text was edited or deleted. |
datetime | YYYY-MM-DDThh:mm:ssTZD | Helps to define the date and time of the deleted text. |
Browser Support:
Related Articles:
The post HTML Delete Tag appeared first on Share Point Anchor.
Top comments (0)