Throughout the book, we use a constant-width
typeface to highlight any
literal element of the HTML/XHTML standards, tags, and attributes. We
always use lowercase letters for tags.[*] We use italic for filenames and to
indicate new concepts when they are defined. Elements you need to supply
when creating your own documents, such as tag attributes and
user-defined strings, appear in constant-width
italic
in the code.
We discuss elements of the language throughout the book, but
you’ll find each one covered in depth (some might say in nauseating
detail) in a shorthand, quick-reference definition box that looks like
the one that follows (for the <title>
element). The first line of the
box contains the element name, followed by a brief description of its
function. Next, we list the various attributes, if any, of the element:
those things that you may or must specify as part of the element.
The icon ‼ identifies tags and attributes that aren’t in the HTML 4.01 or XHTML 1.0 standards, and those that are handled very differently between the various popular browsers.
The description also includes the HTML ending tag, if any, for the
element, along with a general indication of whether the end tag may be
safely omitted in general use in HTML. For the few tags that require end
tags in XHTML, but do not have them in HTML, the language lets you
indicate that by placing a forward slash (/
) before the tag’s closing bracket, as in
<br/>
. In these cases, the tag
may also contain attributes, indicated with an intervening ellipsis,
such as <br ... />
.
The “Contains” header names the rule in the HTML grammar that defines the elements to be placed within this tag. Similarly, the “Used in” header lists those rules that allow this tag as part of their content. We define these rules in Appendix A.
Finally, HTML and XHTML are fairly intertwined languages. You will occasionally use elements in different ways depending on context, and many elements share identical attributes. Wherever possible, we place a cross-reference in the text that leads you to a related discussion elsewhere in the book. These cross-references, like the one at the end of this paragraph, serve as a crude paper model of hypertext documentation, one that would be replaced with a true hypertext link should this book be delivered in an electronic format. [The Syntax of a Tag, 3.3.1]
We encourage you to follow these cross-references whenever possible. Often, we cover an attribute briefly and expect you to jump to the cross-reference for a more detailed discussion. In other cases, following the link takes you to alternative uses of the element under discussion or to style and usage suggestions that relate to the current element.
[*] HTML is case-insensitive with regard to tag and attribute names, but XHTML is case-sensitive. And some HTML items, such as source filenames, are case-sensitive, so be careful.
Get HTML & XHTML: The Definitive Guide, 6th Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.