HTML and CSS Reference
In-Depth Information
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.4 Logical style elements
strong text
Causes text to be emphasized or to stand out from surrounding text; usually
displayed in bold
emphasized text
Causes text to be emphasized in relation to other text; usually displayed in
cite text
Identifies a citation or reference; usually displayed in italics
code text
Identifies program code samples; usually a fixed-space font
dfn text
Identifies a definition of a word or term; usually displayed in italics
kbd text
Identifies user text to be typed; usually a fixed-space font
samp text
Shows program sample output; usually a fixed-space font
var text
Identifies and displays a variable or program output; usually displayed in italics
Why do the displays look so similar?
As you look at Table 2.4, you may notice that some tags, such as <cite> and <dfn> , result
in the same type of display (italics) as the <em> 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.
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 topic because many existing Web pages use them. Table 2.5 lists
physical style tags and examples of their use.
Search WWH ::

Custom Search