Web Development and Design Foundations with XHTML, 5th Edition

(Steven Felgate) #1

FAQ


(^44) Chapter 2 XHTML Basics
Why do the displays look so similar?
As you look at Table 2.4, you may notice that some tags, such as and , result
in the same type of display (italics) as the tag in today’s browsers. These tags are logi-
cally describing the text as a citation or definition, but the physical display is usually italics in
both cases. Cascading Style Sheets (see Chapter 3) are a better way to format elements than
logical style tags. However, logical style tags are preferred over physical style tags. If you find
this a little confusing and think that there are too many tags with similar purposes, you are cor-
rect. Please keep in mind that Cascading Style Sheets is the preferred method to format text—
not physical style and logical style elements. However, we introduce physical style and logical
style elements in this chapter because they are still used on the Web.
testing (see section 2.9) and may cause display issues. Appendix D, Comparison of
HTML and XHTML, contains a list of the key syntax rules of XML.
Table 2.4 lists logical style tags and examples of their use.
Table 2.4Logical style elements
Element Example Usage
strongtext Causes text to be emphasized or to stand out from surrounding text; usually
displayed in bold
emphasizedtext Causes text to be emphasized in relation to other text; usually displayed in
italics
citetext Identifies a citation or reference; usually displayed in italics
codetext Identifies program code samples; usually a fixed-space font


dfntext Identifies a definition of a word or term; usually displayed in italics
kbdtext Identifies user text to be typed; usually a fixed-space font
samptext Shows program sample output; usually a fixed-space font
vartext Identifies and displays a variable or program output; usually displayed in italics

XHTML—Physical Style Elements


Physical style elements are sometimes called font style elements because they provide
specific font instructions for the browser. This type of tag is still commonly used and
generated by some Web authoring tools. Be aware that logical style elements and
Cascading Style Sheets provide for a wider range of Web access. Physical style elements
are included in this book because many existing Web pages use them. Table 2.5 lists
physical style tags and examples of their use.