Tuesday, September 14, 2010

Elements for inserted and deleted text

The del and ins elements are used, respectively, to indicate deleted text and inserted text,
typically in a manner akin to the tracking features of word processing packages, although
they do not include the tracking functionality. The del element usually appears in strikethrough
format, whereas ins usually appears underlined. Both accept cite and datetime
attributes. The former enables you to define a URL that explains why text was inserted or
deleted; the latter enables you to define the time and date that the text was amended—
see the <ins> and <del> entries in Appendix A (XHTML Reference) for accepted formats.
Note that these elements cannot be nested inside each other, for obvious reasons.
Following is an example of their use:
<p>I <del>deleted this</del> and then <ins>inserted this</ins>.</p>


 

The default style of the ins element can prove problematic online. Because links are
underlined by default, users may attempt to click text marked up as inserted text and
wonder why nothing happens. It’s a good idea to amend the tag’s visual appearance by
changing the underline color. This can be done by removing the default underline and
replacing it with a bottom border, like so:
ins {
text-decoration: none;
border-bottom: 1px solid red;
}
The bottom border resembles an underline, although it appears lower than the default
underline, which further differentiates inserted text from hypertext links.

No comments:

Post a Comment