HTML5 <del> Tag

The HTML <del> tag is used to represent a range of text that has been deleted from a document. This element is often rendered with strike-through text. However, this behavior is not required by the Spec.

The only content permitted inside this element is Transparent. Transparent content constitutes of any element whose tags (just tags not the content inside them) can be removed from the markup while still keeping the markup valid. Both the starting and ending tag are mandatory for this element. The parent of the <del> tag can be any element that accepts phrasing content.

The following style is applied to this element by default:

del {
  text-decoration: line-through;
}

Here is an example of using this tag:

<h4>My To Do List for this Month:</h4>
<ul>
  <li><del datetime="2016-02-21T01:25-07:00">Learn basics of HTML.</li>
  <li><del datetime="2016-03-15T01:25-07:00">Learn Basics of CSS.</del></li>
  <li>Create a Responsive Webpage.</li>
  <li>Learn basics of JavaScript.</li>
</ul>

Attributes

cite

This attribute is used to specify a URI for a resource that explains the change (for example, meeting minutes).

datetime

This attribute is used to indicate the time and date of the change and must be a valid date string with an optional time. If the value cannot be parsed as a date with an optional time string, the element does not have an associated time stamp.

Examples

See the Pen HTML del Tag by Tutorialio (@tutorialio) on CodePen.

Further Reading

  1. Read more about the HTML <del> element on MDN.
  2. You can also read the HTML <del> tag reference on W3C.

Reader Comments

1. You can register or login to post a comment. Asking readers to register improves the quality of discussion.

2. As a registered user, you will also get to access features like choosing between a light and dark theme or anything else that we might implement in future.

Follow Us For Updates

FacebookTwitterGoogle+
Go To Top