Skip to: content, navigation

by Ian Lloyd

del (HTML element)

Spec
Depr. Empty Version
No No HTML 4
Browser support full matrix
IE5.5+ FF1+ Saf1.3+ Op9.2+
Partial Partial Partial Partial

Example

The following text was hastily revised, yet the author chose to identify what was changed:

<p>Bernie enjoyed nothing more than a <del
    datetime="2007-11-05T23:31:05Z">night out on the town at his
    favorite drag queen show</del> <ins
    datetime="2007-11-05T23:33:32Z">quiet night in with a warm cup of
    cocoa.</ins></p>
Type
inline element or block-level element (depending on context)
Contains
inline elements, block-level elements
Contained by
inline elements, block-level elements

Description

The del element is used to indicate a change that saw the author delete content which appeared in an earlier version of a document.

del can be used to identify any removed content, from a specific word or phrase that’s been removed (in which case the del is deemed to be an inline element) to an entire block of content, which could include a number of nested block-level elements (in this case, the del is deemed to be a block-level element).

The del element has a counterpart in the ins element, which is used to identify an insertion of content into a document.

Both elements have optional attributes that provide extra information about the change that has been made to the document, namely the cite and datetime attributes.

The example code above would render on screen as shown in Figure 1.

Figure 1. The del element in action Example of ins and del elements

Whether a del element is determined to be inline or block level depends on the context in which it’s used. If the del is an immediate child of body (with a Strict Doctypes declaration), it’s a block-level element. If it’s a child of a p element, it’s deemed to be an inline element.

Note that a del element can’t contain block-level child elements when it’s used in a context that would make it inline (for example, a del contained in a p can’t contain a block-level element).

Use This For …

This element can be used for inline text content, or blocks of content.

Compatibility

IE5.5Partial
6.0Partial
7.0Partial
Firefox1.0Partial
1.5Partial
2.0Partial
Safari1.3Partial
2.0Partial
3.0Partial
Opera9.2Partial
9.5Partial

The del element has good browser support; all the major browsers render deleted text with a strikethrough.

The browser support charts show partial rather than full support, because of the lack of obvious support for the element-specific attributes (cite and datetime).

In this Section

Related Reading

User-contributed notes

There are no comments yet.

Add a note

To post a note on this topic, please log in with your SitePoint username and password. If you don't have an account yet, you can create a new account for free.

Related Products

The Principles of Beautiful Web Design

Best Seller!

You don’t need to go to Art School to design great looking web sites!

Book Cover: The Principles of Beautiful Web Design

Download the FREE sample chapters