HTML <del> element is employed to indicate the portion of text that has been eliminated or deleted from the document. This element serves as a markup for the removed content. Typically, the browser displays it by striking a line through the deleted text, although this appearance can be customized using CSS properties.
Note: To identify the deleted text and inserted text use <ins> tag with <del> which will display deleted and inserted text in a document.
Syntax
Example
<del> Content........</del>
Below are some details regarding the HTML <del> element:
| Display | Inline |
|---|---|
| Start tag/End tag | Both Start and End tag |
| Usage | Textual |
Example 1
Example
<!DOCTYPE html>
<html>
<head>
<title>Del tag</title>
</head>
<body>
<h2>Example of Del Tag</h2>
<p>It represent the <del> deleted </del> text. </p>
</body>
</html>
Output:
Example 2
Using CSS and <ins> tag
Example
<!DOCTYPE html>
<html>
<head>
<title>Del tag</title>
<style>
del{
color: red;
background-color: #fde1e5;}
ins{
color:#16c39a;}
</style>
</head>
<body>
<h2>Example of Del Tag</h2>
<p>Rishi came to Rahul's palce to <del>shock </del> <ins> surprise </ins> him</p>
</body>
</html>
Output:
Attribute
| Attribute | Value | Description |
|---|---|---|
cite |
URL | It specifies a URL of the resource which explains change or reason of deleting text. |
| datetime | YYYY-MM-DDThh:mm:ssTZD | It specifies the date and time when text is deleted. |
Global Attribute
HTML <del> element facilitates the implementation of Global attributes.
Event Attribute
HTML <del> tag enables the integration of Event attributes.
Supporting Browsers
| Element | Chrome | IE | Firefox | Opera | Safari |
|---|---|---|---|---|---|
<del> |
Yes | Yes | Yes | Yes | Yes |