HTML and CSS Reference
In-Depth Information
Table 2.5 Physical style elements
bold text
Displays text as bold
Displays text in italics
big text
Displays text larger than normal size
small text
Displays text smaller than normal size
sub text
Displays small text below the baseline
Displays small text above the baseline
sup text
strike text
Displays text with a line through it (deprecated)
u text
Displays text underlined; avoid using this because underlined text can be con-
fused with hyperlinks (deprecated)
teletype text
Displays text in teletype or fixed-space font
You may have noticed that the <strong> logical style tag usually has the same effect as
the <b> physical style tag. Also, the <em> logical style tag usually has the same effect as
the <i> physical style tag. In order to create XHTML that describes logical styles
instead of font instructions for browsers, use <strong> instead of <b> and use <em>
instead of <i> . As you continue to study Web development, you will learn about
Cascading Style Sheets and their use in text formatting.
Special XHTML Characters
In order to use special characters such as quotation marks, greater than ( > ), lesser than
( < ), and the copyright symbol ( © ) in your Web document, you need to use special char-
acters, sometimes called entity characters. For example, if you wanted to include a
copyright line on your page as follows:
© Copyright 2008 My Company. All rights reserved.
You would use the special character &copy; to display the copyright symbol. The
XHTML would look as follows:
<p>&copy; Copyright 2008 My Company. All rights reserved.</p>
Another useful special character is &nbsp; , which stands for nonbreaking space. You
may have noticed that Web browsers treat multiple spaces as a single space. If you need
a small number of spaces in your text, you may use &nbsp; multiple times to indicate
multiple blank spaces. This is acceptable if you simply need to tweak the position of an
element a little. If you find that your Web pages contain many &nbsp; special charac-
ters in a row, you should use a different method to align elements, such as a table or
Cascading Style Sheets.
See Table 2.6 and Appendix B, Special Characters, for a description of special charac-
ters and their codes.
Search WWH ::

Custom Search