Table of contents

HTML <del> Tag

What is HTML <del> Tag?

The HTML del tag is used to represent deleted or removed text in a webpage. When content has been updated or changed, the del tag shows which text was removed by displaying it with a strikethrough line. It is often used in combination with the ins (inserted) tag to indicate modifications in a document. This tag helps both readers and search engines understand changes made to the content. It is also useful for version tracking, content editing, and revision history in web pages or articles.

Syntax of the HTML <del> Tag

plaintext
<del>Deleted Text Here</del>

The opening tag <del> marks the beginning of the deleted text, and the closing tag </del> marks its end. Any text placed between these tags will appear with a line through it, showing that it has been removed or replaced.

Examples of HTML <del> Tag

Example 1: Basic HTML Del Tag

plaintext
<!DOCTYPE html>
<html lang="en">
<body>

<p>The original price was <del>$50</del> now it is $35.</p>

</body>
</html>

In this example, the del tag shows that the old price ($50) has been removed. The new price ($35) appears without any strikethrough, helping users see the updated information easily.

Example 2: SEO Optimized Del Tag Example 

plaintext
<!DOCTYPE html>
<html lang="en">
<body>

<h2>Exclusive Offer - Scholar247</h2>
<p>Our premium course was priced at <del>$199</del> now available for only $99!</p>

</body>
</html>

This example uses the del tag to highlight a price change for an SEO-friendly promotional message. Showing both old and new prices makes the offer more appealing to users and helps in conversions. The use of clear text and keywords like “Scholar247” supports better search visibility.

Attributes of the HTML <del> Tag

The HTML del tag supports the following attributes:

cite: Specifies the source or reason for the deleted text. It usually contains a URL pointing to a document explaining the change.
datetime: Indicates the date and time when the text was deleted. This is useful for content tracking and historical reference.

These attributes help maintain content accuracy and provide additional context to both users and search engines.

Best Practices for HTML <del> Tag

• Use the del tag only for meaningful text changes, not for design styling.
• Combine it with the ins tag to show both deleted and newly added content clearly.
• Use the datetime attribute when maintaining revision records or audit trails.
• Avoid overusing the del tag to prevent confusion for readers.
• Use it for transparency in pricing, updates, or content revisions to improve user trust.

FAQs About the HTML <del> Tag

What is the purpose of the HTML del tag?

The del tag is used to show text that has been removed or replaced in a webpage, usually displayed with a strikethrough.

Can the del tag improve SEO?

Yes, it can help show transparency in content updates, which search engines consider valuable for freshness and accuracy.

What attributes can I use with the del tag?

The main attributes are cite, which points to the reason or source of deletion, and datetime, which shows when the deletion occurred.

Can I use del and ins tags together?

Yes, it is common to use del for deleted text and ins for newly added text to show both versions clearly in a revision or update.

How does the del tag display in a browser?

Browsers usually display deleted text with a strikethrough line, visually indicating that it has been removed or is no longer valid.

HTML

Related Articles