Web design creating cool web sites with html, xhtml, and css

Page 72

Chapter 3: Presenting Text Attractively

45

Now take a look at how bold and italic work in Web page design. Italic and boldface format­ ting require paired tags: • The italic formatting tag is <i>, which is paired with </i>. • The boldface formatting tag is <b>, and its partner is </b>. Here’s how a brief HTML passage looks with both bold and italics text: It turns out <b>Starbucks</b>, the popular and fast-growing coffee chain, got its name from the coffee-loving first mate in Melville’s classic tale of pursuit and revenge, <i>Moby Dick< /i >, although few people realize it.

Figure 3-1 shows how the preceding information looks in a Web browser. Notice I made a slight mistake in the coding: The name of the book, Moby Dick, has an open italics tag, but I incorrectly added spaces within its partner, the close italics tag. As a result, the request to end the italics passage doesn’t take effect when the title of the book is complete. Also, if you view this exact same snippet in Explorer and Navigator, you find that each has a slightly dif­ ferent way of dealing with an error of this form. Another good reason to double-check your Web pages in multiple browsers!

Figure 3-1: An example of boldface, italics, and a coding mistake.

caution

Always follow the opening angle bracket of an HTML formatting tag with the format code immediately; no spaces are allowed.


Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.