Appendix B. XHTML 1.1 and CSS 2 Quick Reference

XHTML 1.1 represents a modern reformulation of HTML as an XML application, allowing extensions to the language to be more easily defined and implemented. This appendix provides a quick reference to the elements and attributes of XHTML 1.1 that you are most likely to see and use, as well as the style properties that CSS 2 comprises. For the complete specifications, visit http://www.w3.org/.

To make the information readily accessible, this appendix organizes HTML elements by their function in the following order:

• Structure

• Text phrases and paragraphs

• Text formatting elements

• Lists

• Links

• Tables

• Embedded content

• Style

• Forms

• Scripts

The elements are listed alphabetically within each section, and the following information is presented:

• Usage–Gives a general description of the element.

• Start/End Tag–Indicates whether these tags are required, optional, or illegal.

• Attributes–Lists the attributes of the element with a short description of their effect. Any attributes that are used for mouse control or to invoke client-side scripting are not indicated here; please see the full specification at the W3C web site for those action-oriented attributes.

• Empty–Indicates whether the element can be empty.

• Notes–Relates any special considerations for using the element.

The CSS style properties follow a similar arrangement except that they are listed with acceptable values, as opposed to attributes.

Note

XHTML 1.1 includes several fundamental attributes that apply to a significant number of elements. These are referred to within each element listing as core, i18n, and events. These attribute groups are covered in detail after all the XHTML elements are presented. There you’ll find the specific attributes associated with each of these attribute groups.

XHTML Structure

XHTML relies on several elements to provide structure to a document (as opposed to structuring the text within) as well as to provide information that is used by the browser or search engines.

image

image

image

image

Note

You might run across HTML web pages that use the <div> element with an attribute named align. This attribute was removed in XHTML and HTML 5, with the new approach to alignment involving the text-align CSS style property. This style property is covered later in this appendix.

image

image

Tip

The profile attribute is not allowed in HTML 5.

image

image

image

Tip

The scheme attribute is not allowed in HTML 5.

image

image

XHTML Text Phrases and Paragraphs

Text phrases (or blocks) can be structured to suit a specific purpose, such as creating a paragraph. This should not be confused with modifying the formatting of the text.

image

image

image

image

image

image

image

image

image

image

XHTML Text Formatting Elements

General text characteristics (such as the size, weight, and style) can be modified using these elements, but the preferred approach is to use CSS style properties. Later in the appendix, you’ll find a complete reference for these properties, which provide an incredible amount of control over text formatting.

image

image

Tip

This element has been removed in HTML 5 because its effect is purely presentational and thus better handled by CSS.

image

image

image

Tip

This element has been removed in HTML 5 because its effect is purely presentational and thus better handled by CSS.

XHTML Lists

You can organize text into a more structured outline by creating lists. Lists can be nested.

image

image

image

image

image

image

XHTML Links

Hyperlinking is fundamental to XHTML. These elements enable you to link to other documents, other locations within a document, or external files.

image

Tip

The charset, name, rev, shape, and coords attributes are not allowed in HTML 5.

image

image

Tip

The charset, rev, and target attributes are not allowed in HTML 5.

XHTML Tables

Tables are meant to display data in a tabular format. Prior to XHTML, tables were widely used for page layout purposes, but with the advent of style sheets, this is officially discouraged by the W3C as well as the authors of this book.

image

Tip

The width, align, char, charoff, and valign attributes have been removed in HTML 5 because their effects are purely presentational and thus better handled by CSS.

image

image

Tip

The width, align, char, charoff, and valign attributes have been removed in HTML 5 because their effects are purely presentational and thus better handled by CSS.

image

Tip

The width, align, border, frame, rules, cellspacing, cellpadding, and summary attributes have been removed in HTML 5 because their effects are purely presentational and thus better handled by CSS.

image

Tip

The align, char, charoff, and valign attributes have been removed in HTML 5 because their effects are purely presentational and thus better handled by CSS.

Tip

The axis, align, char, charoff, valign, and scope attributes have been removed in HTML 5 because their effects are purely presentational and thus better handled by CSS.

image

image

Tip

The align, char, charoff, and valign attributes have been removed in HTML 5 because their effects are purely presentational and thus better handled by CSS.

Tip

The axis, axes, align, char, charoff, and valign attributes have been removed in HTML 5 because their effects are purely presentational and thus better handled by CSS.

image

image

Tip

The align, char, charoff, and valign attributes have been removed in HTML 5 because their effects are purely presentational and thus better handled by CSS.

Tip

The align, char, charoff, and valign attributes have been removed in HTML 5 because their effects are purely presentational and thus better handled by CSS.

image

XHTML Embedded Content

Also called inclusions, embedded content applies to images, imagemaps, Java applets, Flash animations, and other multimedia or programmed content that is placed in a Web page to provide additional functionality.

image

Tip

The hspace and vspace attributes have been removed in HTML 5 because their effects are purely presentational and thus better handled by CSS.

image

image

Tip

The hspace and vspace attributes have been removed in HTML 5 because their effects are purely presentational and thus better handled by CSS.

image

image

XHTML Style

Style sheets (both inline and external) are incorporated into an HTML document through the use of the <style> element

image

XHTML Forms

Forms create an interface for the user to select options, enter information, and return data to the Web server for processing.

image

image

image

image

image

image

image

image

XHTML Scripts

Scripts make it possible to process data and perform other dynamic events. Scripts are included in web pages thanks to the <script> element, which also identifies the specific scripting language being used (JavaScript, VBScript, and so on.).

image

image

XHTML Common Attributes

The following six attributes are abbreviated as core in the preceding sections:

id="id"–A global identifier.

class="styleclasses"–A list of classes separated by spaces.

style="styles"–Style information.

title="title"–Provides more information for a specific element (as opposed to the <title> element, which titles the entire Web page).

accesskey="shortcut"–Sets the keyboard shortcut used to access an element.

tabindex="taborder"–Sets the tab order of an element.

The following two attributes for internationalization are abbreviated as i18n in the preceding sections:

lang="lang"–The language identifier.

dir="textdir"–The text direction (ltr, rtl).

The following intrinsic events are abbreviated events. For more information on their application in specific elements, see the W3C specification:

onclick="eventcode"–A pointing device (such as a mouse) was single-clicked.

ondblclick="eventcode"–A pointing device (such as a mouse) was double-clicked.

onmousedown="eventcode"–A mouse button was clicked and held down.

onmouseup="eventcode"–A mouse button that was clicked and held down was released.

onmouseover="eventcode"–A mouse moved the cursor over an object.

onmousemove="eventcode"–The mouse was moved.

onmouseout="eventcode"–A mouse moved the cursor off an object.

onkeypress="eventcode"–A key was pressed and released.

onkeydown="eventcode"–A key was pressed and held down.

onkeyup="eventcode"–A key that was pressed has been released.

CSS Dimension Style Properties

Quite a few CSS style rules rely on dimensional properties in one form or another. It would be difficult to size elements with them.

image

image

image

image

image

image

image

CSS Text and Font Style Properties

The heart of CSS styling lies in the text and style properties, which give you an incredible amount of control over the appearance of Web page text.

image

image

image

image

image

image

image

image

image

image

image

image

image

image

image

CSS Background Style Properties

There are several CSS style properties that can be used to alter the backgrounds of pages and individual elements on pages.

image

image

image

image

image

image

CSS Border Style Properties

Every block element has a border that can be styled. Although you can certainly leave borders invisible, there are several styles that can be applied to element borders.

image

image

image

image

image

image

image

image

image

image

image

image

image

image

image

image

image

image

image

image

CSS Margin Style Properties

Margins allow you to add a bit of spacing around the outer edge of an element, outside of the element’s border.

image

image

image

image

image

CSS Padding Style Properties

Padding allows you to add space around an element, inside of the element’s border.

image

image

image

image

image

CSS Layout and Display Style Properties

The layout and display properties in CSS play an extremely important role in determining how elements are laid out and arranged on the page.

image

image

image

image

image

image

image

image

image

image

image

image

image

image

CSS List and Marker Style Properties

You might not have realized how much flexibility there is when it comes to the styling of lists via CSS. Several CSS styles apply to lists and the list-item markers (or bullets) within the lists.

image

image

image

image

CSS Table Style Properties

There are a few advanced table properties that enable you to fine-tune the manner in which tables are rendered and displayed.

image

image

image

image

image

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset