HTML <del> Tag Definition, Usage and Examples

The <del> HTML Tag is used to indicate a section of text that has been deleted from a document. This can be used, for example, to render “track changes” or source code diff information. The <ins> HTML Tag can also be used in the opposite direction: to indicate newly added text to the document. The <del> HTML Tag is part of the formatting tags category in HTML Element Reference. The attributes of the <del> HTML Tag are cite, datetime, global and event attributes.

<del> code block example to learn how it works is given below. 

<del>Deleted text</del>

The second example usage of the “<del>” code block example is below. 

<title> My bucket List </title>
<ol>
<li><del>hiking</del></li>
<li><del>surfing</del></li>
<li><del>paragliding</del></li>
<li>go to Japan</li>
</ol>

What is <del> HTML Tag?

The <del> HTML Tag is used to indicate that a section of text has been deleted from the document. Although web browsers default to rendering deleted text as strike-through text, this property can be changed using the CSS text-decoration property. A starting and ending tag are required for the <del> HTML Tag.

How to Use <del> HTML Tag?

To use <del> HTML Tag, the web developer should insert the deleted text between the start and end tags as <del></del>. Then, it will delete text.

Example Usage of <del> HTML Tag?

The following example of usage of <del> HTML Tag is given below.

<title>"Household Chores: To Do list"</title>
<ol>
<li><del>clean the bedroom</del></li>
<li><del>wash the dishes</del></li>
<li><del>wash the clothes</del></li>
<li>clean the living room</li>
</ol>

What are the Attributes of <del> HTML Tag?

There are multiple attributes for the <del> HTML Tag. The following attributes are listed below.

  • cite attribute: The <del> HTML Tag supports cite attribute. The cite attribute specifies a hyperlink to a document that provides context for the text deletion/change.
  • datetime attribute: The <del> HTML Tag supports datetime attribute. The datetime attribute indicates when the text was deleted/modified.
  • Global Attributes: The <del> HTML Tag supports Global Attributes. All HTML elements, even those not specified in the standard, can have global attributes. This means that any non-standard elements must nevertheless allow certain characteristics, even if using such elements makes the content non-HTML5 compliant.
  • Event Attributes: The <del> HTML Tag supports Event Attributes. The Event Attributes always have a name that begins with “on” and is followed by the name of the event for which it is intended. They specify a script to run when an event of the defined type is dispatched to the element with the specified attributes.

What are the Default CSS Settings for <del> HTML Tag?

The following is the Default CSS Setting for the <del> HTML Tag.

del {
    text-decoration: line-through;
    background-color: #fbb;
    color: #555;
}
ins {
    text-decoration: none;
    background-color: #d4fcbc;
}
blockquote {
    padding-left: 15px;
    border-left: 3px solid #d7d7db;
    font-size: 1rem;
}

What are the Related other HTML Tags to <del>?

The other related HTML Tags to <del> HTML Tag are listed below.

  • <address> HTML Tag: The <address> HTML Tag is related to <del> HTML Tag because they are both in formatting HTML Tags. The <address> HTML Tag is used to specify the author of a website or document’s contact information.
  • <bdi> HTML Tag: The <bdi> HTML Tag is related to <del> HTML Tag because they are both in formatting HTML Tags. The <bdi> HTML Tag is used to create text that is written in a different direction than the rest of the text.
  • <center> HTML Tag: The <center> HTML Tag is related to <del> HTML Tag because they are both in formatting HTML Tags. To centralize the text in HTML, the <center> HTML Tag is used.
  • <cite> HTML Tag: The <cite> HTML Tag is related to <del> HTML Tag because they are both in formatting HTML Tags. The <cite> HTML Tag is used to specify the work’s title.

Holistic SEO
Follow SEO

Leave a Comment

HTML <del> Tag Definition, Usage and Examples

by Holistic SEO time to read: 3 min
0