Read HTML The Definitive Guide Online
Authors: Chuck Musciano Bill Kennedy
segment ought to be displayed, and lang lets you specify the language used within that tag.
[The dir
attribute, 3.5.1.1] [The lang attribute, 3.5.1.2]
4.9.1.2 The class, id, style, and title attributes
Use the style attribute to specify an inline style for the
You may assign a unique id to the
tag, as well as a title, using the respective attribute and accompanying quote-enclosed string value.4.9.1.3 Event attributes
Like with most other tagged segments of content, user-related events can happen in and around the
tag, such as when a user clicks or double-clicks within its display space. Many of these events are recognized by the browser if it conforms to the HTML 4.0 specification (none do fully).With the respective "on" attribute and value, you may react to that event by displaying a user dialog
box or activating some multimedia event. Section 13.3.3 in
Chapter 13
4.8 Block Quotes
4.10 Special Character
Encoding
4.10 Special Character Encoding
For the most part, characters within HTML documents that are not part of a tag are rendered as is by the browser. However, some characters have special meaning and are not directly rendered, while other characters can't be typed into the source document from a conventional keyboard. Special characters need either a special name or a numeric character encoding for inclusion in an HTML
document.
4.10.1 Special HTML Characters
As has become obvious in the discussion and examples leading up to this section of the book, three characters in HTML source documents have very special meaning: the less-than sign (<), the greater-than sign (>), and the ampersand (&). These characters delimit tags and special character references. They'll confuse a browser if left dangling alone or with improper tag syntax. So you've got to go out of your way to include their actual, literal characters in your HTML documents.[
5
]
[5] The only exception is that these characters may appear literally within the
Similarly, you've got to use a special encoding to include double quotation mark characters within a quoted string, or when you want to include a special character that doesn't appear on your keyboard but is part of the ISO Latin-1 character set implemented and supported by most browsers.
4.10.2 Inserting Special Characters
To include a special character in your HTML document, enclose either its standard entity name or a pound sign (#) and its numeric position in the Latin-1 standard character set[
6
] inside a leading ampersand and an ending semicolon, without any spaces in-between. Whew. That's a long explanation for what is really a simple thing to do, as the following example illustrates. The example shows how to include a greater-than sign in a snippet of code by using the character's entity name. It also demonstrates how to include a greater-than sign in your HTML text by referencing its Latin-1
numeric value:
[6] The popular ASCII character set is a subset of the more comprehensive Latin-1
character set. Composed by the well-respected International Organization for Standardization (ISO), the Latin-1 set is a list of all letters, numbers, punctuation marks, and so on, commonly used by Western language writers, organized by number and encoded with special names.
Appendix E
contains the complete Latin-1 character set and
encoding.
if a > b, then t = 0
if a > b, then t = 0
Both examples cause the text to be rendered as: if a > b, then t = 0
The complete set of character entity values and names are in
Appendix E. You could write an entire
HTML document using character encoding, but that would be silly.
4.9 Addresses
5. Rules, Images, and
Multimedia