HTML <del> tag

Updated: 04/09/2024 by Computer Hope
HTML del tag

When writing HTML, the <del> tag is an inline element that indicates that a block of text was deleted from a web page. It is usually visually illustrated using strike-through text. The following sections contain information about this tag, including examples of its use and related attributes and browser compatibility.

Example of <del> code

<p>My favorite food is <del>spaghetti</del> <ins>pizza</ins>.</p>

Example result

My favorite food is spaghetti pizza.

Attributes

An attribute dictates certain aspects of an HTML element within an HTML tag. Attributes have a name and value pair; all tags support standard attributes. The following table shows the current unique HTML attributes for the <del> tag and describes each.

Attribute Description
cite Designates a URL (uniform resource locator) to a document explaining why the text was deleted.
datetime Designates the date and time the text was deleted.

Compatibility

Edge Internet Explorer Firefox Safari Opera Chrome
All versions All versions All versions All version All versions All versions

Should I use the <s> or <del> tag?

The <s> tag should be used if the text is no longer relevant, incorrect, or obsolete. The <del> tag should be used if the text was deleted but needs to remain for historical reasons. For example, you may use the <s> tag to cross out the previous price of a product and use <del> to show sold products.

Block of text, Browser, Compatibility, Container tag, CSS, HTML ins tag, URL, Web design terms