HTML: The Del Tag

HTML del tag

The <del> tag is often used to note where content has been removed from a document.

This tag is for controlling the changes in the versioning of a document. It gives semantic and visual styling with a strikethrough of the change that was made.

In the code below, we made a mistake for Mary. She didn’t have a cow but rather a lamb. So if we want to keep all version information in the document for historical purposes, we use the <del> tag to surround the content that is replaced.

The <del> tag can take two optional attributes:

cite – a http reference to a document URI that describes the change
datetime – a timestamp of when we made the change (YYYY-MM-DDTHH:MM:SS format)

Example Code:

  1. <!DOCTYPE html>
  2. <html>
  3.   <head>
  4.     <title>The Del Tag | Kobashi Computing</title>
  5.   </head>
  6.   <body>
  7.     <main>
  8.       <p>Mary had a little <del cite="" datetime="2016-08-24T01:34:59">cow</del> lamb.</p>
  9.     </main>
  10.   </body>
  11. </html>

Of Interest