Tuesday, August 3, 2010

The <ins> and <del> Elements

These two elements are useful when editing HTML documents.

The ins Element

This element is used to contain inline or block-level content that have been added to a pre-existing document. It indicates that the content was added sometime after the creation of the original document. When used with inline text or inline child elements, browsers underline the inserted text. With block-level elements, Firefox renders them as usual whereas IE7, Safari and Opera underline them.

The del Element

This element is used to contain inline or block-level content that should be deleted or content that should be considered deleted. When used with inline elements, all major browsers render the enclosed text with a line through. When used with child block elements, Firefox renders the text as usual whereas IE7, Safari and Opera render it with a line through.

Attributes

Core Attributes

The core attributes can be applied to these elements.

cite

This attribute's value is a URL of a document that explains the reason for insertion or deletion.

datetime

This attribute's value contains the date, time and timezone of the insertion or deletion. The format of the value is YYYY-MM-DDThh:mm:ssTZD

Example: <del datetime="2008-08-06T16:32+5:30">

The format for the date is YYYY-MM-DD. This is followed by the capital letter "T". After this is the time in 24-hour format - hh:mm:ss. This is followed by the time zone. If the time zone is GMT then the code is "Z". Example: "2008-08-06T16:32Z". For all other time zones, there is a positive or negative time in the format hh:mm to indicate how many hours and minutes it is ahead or behind GMT. Example: "2008-08-06T16:32+5:30"

No comments: