u Underlining Text

<u> Underlining Text

The <u> element displays underlined text. This element was deprecated in HTML 4.0 (you're supposed to use styles instead now), so it is not supported in XHTML 1.0 Strict or XHTML 1.1. It is supported in XHTML 1.0 Transitional and XHTML 1.0 Frameset, however. Here are the attributes of this element:

  • class Gives the style class of the element. (XHTML 1.0 Transitional, XHTML 1.0 Frameset.)

  • dir Sets the direction of text that doesn't have an inherent direction in which you should read it, called directionally neutral text. You can set this attribute to LTR , for left-to-right text, or RTL , for right-to-left text. (XHTML 1.0 Transitional, XHTML 1.0 Frameset.)

  • id Refers to the element; set this attribute to a unique identifier. (XHTML 1.0 Transitional, XHTML 1.0 Frameset.)

  • lang Specifies the base language used in the element. Applies only when the document is interpreted as HTML. (XHTML 1.0 Transitional, XHTML 1.0 Frameset.)

  • style Set to an inline style to specify how the browser should display the element. (XHTML 1.0 Transitional, XHTML 1.0 Frameset.)

  • title Contains the title of the element (which might be displayed in ToolTips). (XHTML 1.0 Transitional, XHTML 1.0 Frameset.)

  • xml:lang Specifies the base language for the element when the document is interpreted as an XML document. (XHTML 1.0 Transitional, XHTML 1.0 Frameset.)

Here are the official XHTML events this element supports: onclick , ondblclick , onmousedown , onmouseup , onmouseover , onmousemove , onmouseout , onkeypress , onkeydown , and onkeyup .

The <u> element offers another easy formatting option, underlining its enclosed text. This element is deprecated in HTML 4.0, so you can't use it in strict XHTML 1.0 or XHTML 1.1. Here's an example putting <u> to work:

Listing ch16_08.html
 <?xml version="1.0"?> <!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" xml:lang="en" lang="en">     <head>         <title>             Using the &lt;u&gt; Element         </title>     </head>     <body>  You can <u>underline</u> text for a little more emphasis.  </body> </html> 

The results of this XHTML appear in Figure 16-6.

Figure 16-6. Displaying underlined text in Netscape Navigator.

graphics/16fig06.gif



Real World XML
Real World XML (2nd Edition)
ISBN: 0735712867
EAN: 2147483647
Year: 2005
Pages: 440
Authors: Steve Holzner

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net