HTML and CSS Reference
In-Depth Information
B
APPENDIX
Fonts
This appendix contains a quick reference for commonly available fonts and brief
discussions of downloadable fonts and various text replacement techniques to
improve online typography.
Specifying Fonts
Under HTML 4.01 and transitional XHTML 1.0, you can use the <font> tag to set a font in
a page by setting the face attribute:
<p> This is standard text. <font face="Britannic Bold"> This is text in
Britannic Bold? </font> More standard text. </p>
A Web browser that reads this HTML fragment should render the text in the font named in
the face attribute, but only for users who have the font installed on their systems. To
address the possibility of missing fonts, multiple font names can be listed using the face
attribute:
<p> This is standard text. <font face="Arial, Helvetica, sans-serif">
This should be in one of the Sans Serif fonts listed or default to the
standard sans-serif font installed </font> This is more standard text. </p>
Here, the browser reads the comma-delimited list of fonts until it finds a font it supports. If
no match is found, the browser will default to the font currently in use.
Strict variants of (X)HTML as well as the upcoming HTML5 specification remove the
role of markup in setting fonts. Of course CSS supports the same basic approach to setting
751
Search WWH ::




Custom Search