<b> Making Text BoldThe <b> element makes its enclosed text appear in boldface. This element is supported in XHTML 1.0 Strict, XHTML 1.0 Transitional, XHTML 1.0 Frameset, and XHTML 1.1. Here are its attributes:
Here are the official XHTML events this element supports: onclick , ondblclick , onmousedown , onmouseup , onmouseover , onmousemove , onmouseout , onkeypress , onkeydown , and onkeyup . The <b> element gives you a simple inline way of bolding text. Although plenty of experts would prefer that you use stylesheets to display text in bold, you can still use the <b> element. The following listing displays text in both italics and bold. (I'm using the line break element, <br> , which we'll see later, to separate the lines of text.) Listing ch16_07.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> Bold and Italic Text </title> </head> <body> <i>This text is italic.</i> <br /> <b>This text is bold.</b> <br /> <b><i>This text is both.</i></b> </body> </html> The results of this XHTML appear in Figure 16-5; you can see text that's bold, italic, and both bold and italic. The <b> tag is a favorite one among Web page authors because it's so easy to use. Figure 16-5. Displaying bold and italic text in Netscape Navigator.
|