<del> Tag Examples

Examples of the del tag in HTML 5
<p>... <del datetime="2010-10-31">deleted from paragraph on Halloween 2010</del> ...</p>

<del datetime="2010-11-30T23:59-05:00"><p>This entire paragraph was
   deleted just before midnight Eastern time on the last day of November.
</p></del>

<p>... <del datetime="2010-10-31">This is just one reason for
   always using the &lt;p&gt; tag for paragraphs in HTML.</del>
</p>
<p><del datetime="2010-10-31">Another reason is that it</del>
   <ins>Using the &lt;p&gt; tag</ins> is highly recommended by the HTML specifications, which says
   <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/edits.html#edits-and-paragraphs">
      "authors are strongly encouraged to always mark up all paragraphs with the p element"</a>.
</p>

The last example includes an insertion using HTML editing code and also shows that a single <del> tag cannot be used to mark up part of one paragraph along with another paragraph since that would result in mismatched tags. Two <del> tags need to be used for that. This rule applies even if the <p> tags for one of the paragraphs were implied rather than coded explicitly.

Deleting List Items in HTML 5

Deletion of a list item from an HTML list is indicated by coding the <del> tag inside the <li> tag:

<ul>
<li>first list item</li>
<del><li>deleted list item</li></del>
<li><del>deleted list item</del></li>
</ul>