In this hour you learned that attributes are used to specify options and special behavior of many HTML tags, and you also learned to use the style attribute with CSS style rules to center or right-justify text. You also found out how to create and combine three basic types of HTML list: ordered lists, unordered lists, and definition lists. Lists can be placed within other lists to create outlines and other complex arrangements of text. This hour also showed you how to make text appear as boldface or italic, or with superscripts, subscripts, underlines, special symbols, and accented letters. You saw how to make everything line up properly in preformatted passages of monospaced text and how to control the size, color, and typeface of any section of text on a web page. Table 5.3 summarizes the tags and attributes discussed in this hour. Don't feel like you have to memorize all these tags, by the way! That's why you have this book: You can look up the tags when you need them. Remember that all the HTML tags are listed in Appendix C, "Complete XHTML 1.1 and CSS 2 Quick Reference." Table 5.3. HTML Tags and Attributes Covered in Hour 5Tag/Attribute | Function |
---|
<em>…</em> | Emphasis (usually italic). | <strong>…</strong> | Stronger emphasis (usually bold). | <b>…</b> | Boldface text. | <i>…</i> | Italic text. | <tt>…</tt> | Typewriter (monospaced) font. | <pre>…</pre> | Preformatted text (exact line endings and spacing will be preservedusually rendered in a monospaced font). | <big>…</big> | Text is slightly larger than normal. | <small>…</small> | Text is slightly smaller than normal. | <sub>…</sub> | Subscript. | <sup>…</sup> | Superscript. | <div>…</div> | A region of text to be formatted. |
Attributes | |
---|
| Align text to center, left, or right. (Can also be used with <p>, <h1>, <h2>, <h3>, and so on.) |
| The typeface (family) of the font, which is the name of a font, such as Arial. (Can also be used with <p>, <h1>, <h2>, <h3>, and so on.) |
| The size of the font, which can be set to small, medium, or large, as well as x-small, x-large, and so on. Can also be set to a specific point size such as 12pt. |
| Changes the color of the text. | <ol>…</ol> | An ordered (numbered) list. |
Attributes | |
---|
| The type of numerals used to label the list. Possible values are decimal, lower-roman, upper-roman, lower-alpha, upper-alpha, and none. | <ul>…</ul> | An unordered (bulleted) list. |
Attributes | |
---|
| The bullet dingbat used to mark list items. Possible values are disc, circle, square, and none. | <li>…</li> | A list item for use with <ol> or <ul>. |
Attributes | |
---|
| The type of bullet or number used to label this item. Possible values are disc, circle, square, decimal, lower-roman, upper-roman, lower-alpha, upper-alpha, and none. | <dl>…</dl> | A definition list. | <dt>…</dt> | A definition term, as part of a definition list. | <dd>…</dd> | The corresponding definition to a definition term, as part of a definition list. |
|