del element

If you don't know what an element is or how you must use it, I recommend you read the "HTML tags and attributes" tutorial that you can find in the HTML tutorials section.

Description

The del element represents content that has been removed from the document. This element, together with the ins element, allows authors to make public editorial changes made to the document. This is useful when the document's readers could benefit from knowing what changes have been made to the document to take it to its current state.

The attributes cite and datetime can be used to provide more information about the update. While cite contains the URI of a resource providing an explanation of the update, datetime can provide a date or time when the changes took effect. Keep in mind that the contents of datetime must comply with the following formats.

Dates

A date syntax is composed by:

  1. A valid month syntax representing year and month.
  2. A minus sign or hypen character ("-").
  3. A two digits day between 1 and the numbers of days for the previously specified month and year.

Example

<time>2014-07-05</time>
<time>1920-12-31</time>

Global dates and times

A global date and time syntax is composed by:

  1. A valid date syntax representing year, month and day.
  2. A capital letter T or a space character (" ").
  3. A valid time syntax representing the time.
  4. A valid time zone syntax representing the time-zone offset.

Example

<time>2014-01-14 00:12-03:00</time>
<time>2014-05-16T20:12+00:30</time>
<time>2201-08-20 03:04:22.5-5:00</time>
<time>2000-04-01T02:00:00.00+4:00</time>

For a global date and time syntax to be a normalised forced-UTC global date and time string, it must be composed by:

  1. A valid date syntax representing year, month and day, converted to UTC time zone.
  2. A capital letter T.
  3. A valid time syntax representing the time, converted to UTC time zone and in its shortest variant (for example, omitting the number of seconds when it's zero).
  4. A capital letter Z.

Example

<time>2014-02-03T22:00Z</time>
<time>2010-01-01T00:00:00.001Z</time>
<time>2050-01-03T23:59Z</time>
<time>1980-12-23T00:05Z</time>

To create a date or a global date and time, you may need some of the following formats:

Months

A month syntax is composed by:

  1. A year greater than zero, consisting of at least four digits.
  2. A minus sign or hypen character ("-").
  3. A month between 1 and 12, consisting of two digits.

Example

<time>2014-07</time>
<time>0512-12</time>

Times

A time syntax is composed by:

  1. Two digits representing an hour between 0 and 23.
  2. A colon character (":").
  3. A two digits minute between 0 and 59.
  4. The following information, which is optional if the number of seconds is zero:
    1. A colon character (":").
    2. Two digits representing the integer part of the seconds, between 0 and 59.
    3. The following information, which is optional if the number of seconds is an integer:
      1. A period or full stop character (".").
      2. The fractional part of the seconds composed by one, two or three digits.

Example

<time>23:59:59.999</time>
<time>10:20:00.000</time>
<time>10:20</time>
<time>10:20:00</time>

Time zones

A time zone syntax is composed by:

  1. A minus sign or hypen character ("-") if the offset is negative, and a plus sign character ("-") otherwise.
  2. Two digits representing an hour between 0 and 23.
  3. Optionally, a colon character (":").
  4. A two digits minute between 0 and 59.

Example

<time>-12:00</time>
<time>+00:00</time>
<time>+00:30</time>
<time>-1100</time>

This format allows a range of time zones wider than what's currently used in practice. The reason for this excess is to improve adaptability to future time zones changes, as they are subject to political decisions.

The del element can contain both, flow (blocks of content usually composed by one or more elements) or phrasing content (small runs of text).

Examples

The example below, shows a piece of document where the author has marked the removed text with the del element to make clear what's been deleted. Here, it's just containing a run of text (phrasing content).

<p>...if you go up, you can pick up 35 coins, and if you go down you can collect an extra life.<del> But beware, you can't get the coins and the extra life together by going up and later down!</del></p>

...if you go up, you can pick up 35 coins, and if you go down you can collect an extra life. But beware, you can't get the coins and the extra life together by going up and later down!

Now, another document with changes made visible, this time, with a full paragraph removed. We're also adding the date and an explanation of the update in the attributes cite and datetime respectively. Remember that cite takes a URI for value, and the contents of datetime must comply with the formats of dates and global dates and times.

<p>...The client can access a server thourgh SSH and FTP.</p>
<del cite="#removed-content-45" datetime="2010-12-11 16:00:41">
  <p>For backward compatibility, you can also enable the telnet protocol.</p>
</del>

...The client can access a server thourgh SSH and FTP.

For backward compatibility, you can also enable the telnet protocol.

In the third and last example, both del and ins are used to mark a replacement of one piece of text by another.

<p>The elected president must have <del>over 50% of the votes in the first round</del><ins>at least 50% of the votes</ins>.</p>

The elected president must have over 50% of the votes in the first roundat least 50% of the votes.

Attributes

Specific attributes

cite

The URL of a resource providing an explanation about the update (why the content was removed?, in conclussion to what debate?, agreed by what percentage of the participants?, etc.)

Example

<p>...it must be approved by four <del cite="why-the-updates.html#update5">senior </del>representatives...</p>

...it must be approved by four senior representatives...

datetime

The date or time when the contents have been removed. Data in this attribute must comply with the regulations of dates and global dates and times.

Example

<p>...<del datetime="2008-05-08">There will be no tolerance in this matter!</del>...</p>

...There will be no tolerance in this matter!...

Global attributes

For information about global attributes refer to this list of global attributes in HTML5.

Events

Global events

For information about global events refer to this list of global events in HTML5.

X

Are you looking for a place to host your next website? I can help you with that!