< Day Day Up > |
HTML 4.0 introduced elements to indicate inserted and deleted text. The <ins> tag is used to show inserted text and might appear underlined in a browser, whereas the <del> tag is used to indicate deleted text and generally appears as struck text. For example, the markup here
<p> There are <del>6</del><ins>5</ins> robot models </p>
shows how a small modification could be made to content using these two elements. It is possible to provide more information about the insert or delete through the use of the core attribute title , which could provide advisory information about the text change as well as the datetime attribute, which could be used to indicate when the change happened . Through the use of scripting, it should be possible to hide various revisions made with this element.
A complete example of the use of <ins> and <del> is shown here; a rendering is given in Figure 3-14. It is important to note that these elements are very difficult to characterize because they can contain any amount of block or inline elements.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en"> <head> <title> Insert and Delete </title> <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" /> </head> <body> <del><h1> Old Heading </h1></del> <ins><h2> New Heading </h2></ins> <p> This paragraph needs some changes. <ins datetime="1999-01-05T09:15:30-05:00" title="New info inserted by TAP."> This is a new sentence. </ins> Here is some more text. </p> </body> </html>
< Day Day Up > |