XHTML Lesson 8: Logical versus Physical styles

Logical styles such as <EM>, <STRONG>, and <CITE> were more commonly used in the early days of web design when browser display of common elements was still chaotic. The <CITE> tag, for example, was used for citations. One browser might display the CITE text with italics and another might display the CITE text with underlined text. Today physical styles, which exactly specify appearance, are accepted and standardized in the major browsers.

Assignment:

Type the code below into any text editor and save it with the name "lesson08.html" in your "mySite" folder. You may view the completed lesson in a new window by clicking here . After you create this page, open it in your Web browser.

<?xml version="1.0" encoding="iso-8859-1"?>
<!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">
<head>
<title>XHTML Lesson 8: Physical Styles</title>
</head>
<body bgcolor="white">
<h1>Physical Styles</h1>
<p>The commonly used physical styles are:</p>
<p><b>Bold</b></p>
<p><i>Italic</i></p>
<p><tt>Monospaced typewriter font</tt></p>
<p><u>Underline</u></p>
<p><s>Strike through</s></p>
<p>Text that displays below the line is called <sub>Subscript.</sub></p>
<p>Text that displays above the line is called <sup>Superscript.</sup></p>
</body>
</html>

A Detailed Explanation:

The code is self-explanatory but one caution must be expressed. Web developers generally avoid using the <u> </u> tag pair because underlined text is associated with links. As a result, underlining text is confusing for your readers. Often italics are the more appropriate choice anyway. One example is a citation of a book in a bibliography. In the old days when typewriters were the only technology available for authors, we would underline the book titles. Today, of course, we use italics because we have word processors.

Previous Lesson | Next Lesson