22.06.2015 Views

Step by Step HTML5

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Applying Bold and Italic Formatting 29<br />

CLEAN UP Close the Notepad and Internet Explorer windows.<br />

Applying Bold and Italic Formatting<br />

Applying bold and italic styles are two ways of making text stand out and attract<br />

attention. You generally use these styles in paragraphs rather than in headings, but it’s<br />

perfectly acceptable to use them anywhere.<br />

For simple boldface and italics, use the and tags, respectively. These are twosided<br />

tags that enclose the text to be formatted. For example:<br />

I had a great time at the party.<br />

The reception will be held at The Arbor Arch in Plainfield.<br />

If you want to apply both bold and italic formatting, you can nest one tag inside the<br />

other. Don’t mix up their order, though. When nesting tags, the rule is: first in, last out. So<br />

this is correct:<br />

The next book we will read is The Catcher in the Rye<br />

In contrast, the following example is wrong, because the order of the ending and<br />

tags are reversed:<br />

The next book we will read is The Catcher in the Rye<br />

Even though the tags in the preceding example are improperly nested, most browsers<br />

will still display them correctly, provided you are using HTML as the document type. In an<br />

XHTML document, however, this type of tag reversal is not accepted.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!