Section A.1. Common Attributes and Events


A.1. Common Attributes and Events

A number of attributes in the HTML 4.01 and XHTML Recommendations are shared by nearly all elements. To save space, they have been abbreviated in this appendix as they are in the Recommendations. This section explains each attribute's shorthand and serves as a reference for the remainder of the appendix.

When Core is listed under Attributes, it refers to the set of core attributes that may be applied to the majority of elements (as noted in each element listing).


id

Assigns a unique identifying name to the element


class

Assigns one or more classification names to the element


style

Associated style information


title

Advisory title/amplification

When Internationalization appears in the attribute list, it means the element accepts the set of attributes used to specify language and reading direction.


lang

Specifies the language for the element by its language code.


xml:lang

XHTML only. This is the attribute for specifying language for elements in XHTML documents.


dir

Specifies the direction of the element (left to right, or right to left).

When Events is listed for the element, it indicates that the core events used by scripting languages are applicable to the element. Additional events that apply to the element that are not part of the core events are listed separately for that element.


onclick

Occurs when the pointing device button is clicked over an element.


ondblclick

Occurs when the pointing device button is double-clicked over an element.


onmousedown

Occurs when the pointing device button is pressed over an element.


onmouseup

Occurs when the pointing device button is released over an element.


onmouseover

Occurs when the pointing device is moved onto an element.


onmousemove

Occurs when the pointing device is moved while it is over an element.


onmouseout

Occurs when the pointing device is moved away from an element.


onkeypress

Occurs when a key is pressed and released over an element.


onkeydown

Occurs when a key is pressed down over an element.


onkeyup

Occurs when a key is released over an element.

a

 <a>...</a> 

Defines an anchor within the document. An anchor is used to create a hyperlink to another document or Internet resource. It can also serve to label a fragment within a document (also called a named anchor), which serves as a destination anchor for linking to a specific point in a document.

Attributes

Core (id, class, style, title), Internationalization, Events (plus onfocus, onblur)


accesskey=" character"

Assigns an access key (shortcut key command) to the link. Access keys are also used for form fields. The value is a single character. Users may access the element by hitting Alt-key (PC) or Ctrl-key (Mac).


charset=" charset"

Specifies the character encoding of the target document. See Chapter 6 for information on character sets.


coords=" x,y coordinates"

Specifies the x,y coordinates for a clickable area in an image map. The HTML 4.01 Recommendation proposes that client-side image maps be replaced by an object element containing the image and a set of anchor elements defining the "hot" areas (with shapes and coordinate attributes). This system has not yet been implemented by browsers.


href=" URL"

Specifies the URL of the destination document or web resource (such as an image, audio, PDF, or other media file).


docPubcolor">"

Gives the link a unique name (similar to the name attribute) so it can be referenced from a link, script, or style sheet. It is more versatile than name, but it is not as universally supported. In XHTML, the id attribute is required for document fragments.


hreflang=" language code"

Specifies the base language of the target document. See Chapter 6 for a list of two-letter language codes.


name=" text"

HTML only; XHTML documents use id for document fragments. Places a fragment identifier within an HTML document.


rel=" relationships"

Establishes one or more relationships between the current document and the target document. Common relationships include stylesheet, next, prev, copyright, index, and glossary.


rev=" relationships"

Specifies one or more relationships from the target back to the source (the opposite of the rel attribute).


shape="rect|circle|poly|default"

Defines the shape of a clickable area in an image map. This is only used in the a element as part of HTML 4.01's proposal to replace client-side image maps with a combination of object and a elements. This system has not yet been implemented by browsers.


tabindex=" number"

Specifies the position of the current element in the tabbing order for the current document. The value must be between 0 and 32767. It is used for tabbing through the links on a page (or fields in a form).


target=" text"

Specifies the name of the window or frame in which the target document should be displayed.


type=" media type"

Specifies the media or content type (MIME type) of the defined content, for example, text/html.

Link examples

To a local file:

 <a href="filename.html">...</a> 

To an external file:

 <a href="http://server/path/file.html">...</a> 

To a named anchor:

 <a href="http://server/path/file.html#fragment">...</a> 

To a named anchor in the current file:

 <a href="#fragment">...</a> 

To send an email message:

 <a href="mailto:username@domain">...</a> 

To a file on an FTP server:

 <a href="ftp://server/path/filename">...</a> 

abbr

 <abbr>...</abbr> 

Identifies the enclosed text as an abbreviation.

Attributes

Core (id, class, style, title), Internationalization, Events


title=" text"

Provides the full expression for the abbreviation. This may be useful for nonvisual browsers, speech synthesizers, translation systems, and search engines.

Example

 <abbr title="Massachusetts">Mass.</abbr> 

acronym

 <acronym>...</acronym> 

Indicates an acronym.

Attributes

Core (id, class, style, title), Internationalization, Events


title=" text"

Provides the full expression for the acronym. This may be useful for nonvisual browsers, speech synthesizers, translation systems, and search engines.

Example

 <acroynym title="World Wide Web">WWW</acronym> 

address

 <address>...</address> 

Supplies the author's contact information, typically at the beginning or end of a document.

Attributes

Core(id, class, style, title), Internationalization, Events

applet

 <applet>...</applet> 

Deprecated. This element (first introduced in Netscape Navigator 2.0) is used to place a Java applet on the web page. The applet element has been deprecated in favor of the object element, but it is still supported and commonly used. Some applets require the use of applet. Furthermore, Navigator 4 and earlier and Internet Explorer 4 do not support Java applets via the object element.

Attributes


Core(id, class, style, title)


align="left|right|top|middle|bottom"

Aligns the applet and allows text to wrap around it (same as image alignment).


alt=" text"

Provides alternate text if the applet cannot be displayed.


archive=" URLs"

Provides a space-separated list of URLs with classes to be preloaded.


code=" class"

Required. Specifies the class name of the code to be executed.


codebase=" URL"

URL from which the applet code is retrieved.


height=" number"

Height of the initial applet display area in pixels.


hspace=" number"

Holds number pixels of space clear to the left and right of the applet window.


name=" text"

Deprecated in XHTML 1.0. Names the applet for reference from elsewhere on the page.


object=" text"

This attribute names a resource containing a serialized representation of an applet's state. Use either code or object in an applet element, but not both.


vspace=" number"

Holds number pixels of space clear above and below the applet window.


width=" number"

Width of the initial applet display area in pixels.

area

 <area /> 

The area element is used within the map element of a client-side image map to define a specific "hot" (clickable) area.

Attributes

Core(id, class, style, title), Internationalization, Events, Focus


alt=" text"

Required. Specifies a short description of the image that is displayed when the image file is not available.


coords=" values"

Specifies a list of comma-separated pixel coordinates that define a "hot" area of an image map.


href=" url"

Specifies the URL of the document or file that is accessed by clicking on the defined area.


nohref

Defines a "mouse-sensitive" area in an image map for which there is no action when the user clicks in the area.


shape="rect|circle|poly|default"

Defines the shape of the clickable area.


target=" text"

Specifies the name of the window or frame in which the target document should be displayed.

b

 <b>...</b> 

Enclosed text is rendered in bold. This is one of the few presentational elements preserved in the XHTML 1.0 Strict and XHTML 1.1 DTDs.

Attributes

Core(id, class, style, title), Internationalization, Events

base

 <base /> 

Specifies the base pathname for all relative URLs in the document. Place this element within the head of the document.

Attributes


href =" url"

Required. Specifies the URL to be used.


target =" name"

Defines the default target window for all links in the document. Often used to target frames.

basefont

 <basefont /> 

Deprecated. Specifies certain font attributes for the content that follows it. It can be used within the head element to apply to the entire document or within the body of the document to apply to the subsequent text.

Attributes


docPubcolor">"

This attribute assigns a name to an element. This name must be unique in a document.


color=" #rrggbb" or " color name"

Deprecated. Sets the color of the following text using hexadecimal RGB values.


face=" typeface" (or list of typefaces)

Deprecated. Sets the font for the following text.


size=" number"

Deprecated. Sets the base font size using the HTML size values from 1 to 7 (or relative values based on the default value of 3). Subsequent relative size settings are based on this value.

bdo

 <bdo>...</bdo> 

Stands for "bi-directional override" and is used to indicate a selection of text that reads in the opposite direction than the surrounding text. For instance, in a left-to-right reading document, the bdo element may be used to indicate a selection of Hebrew text that reads right-to-left (rtl).

Attributes


Core(id, class, style, title)


Events (XHTML only)


dir="ltr|rtl"

Required. Indicates whether the selection should read left to right (ltr) or right to left (rtl).


lang=" language code"

This attribute specifies the language of the element using a language code abbreviation. (See Chapter 6 for a list of language codes.)


xml:lang=" text"

XHTML only. This is the method for specifying languages in XML documents using a language code abbreviation. (See Chapter 6 for a list of language codes.)

big

 <big>...</big> 

By default, big sets the type one font size increment larger than the surrounding text. This is an example of presentational HTML that should be avoided in favor of semantic markup and style sheets for presentation.

Attributes

Core(id, class, style, title), Internationalization, Events

blockquote

 <blockquote>...</blockquote> 

Enclosed text is a quote block consisting of one or more paragraphs.

Attributes

Core(id, class, style, title), Internationalization, Events


cite=" URL"

Provides information about the source from which the quotation was borrowed.

body

 <body>...</body> 

The body of a document contains the document's content. Content may be presented visually (as in a graphical browser window) or aurally (as by a screen reader).

Attributes

Core(id, class, style, title), Internationalization, Events(plus onload, onunload)


alink="# rrggbb" or " color name"

Deprecated. Sets the color of active links (the color while the mouse button is held down during a click). Color is specified in hexadecimal RGB values or by standard web color name.


background=" URL"

Deprecated. Provides the location of a graphic file to be used as a tiling graphic in the background of the document.


bgcolor=" #rrggbb" or " color name"

Deprecated. Sets the color of the background for the document. Color is specified in hexadecimal RGB values or by standard web color name.


link=" #rrggbb" or " color name"

Deprecated. Sets the default color for all the links in the document. Color is specified in hexadecimal RGB values or by standard web color name.


text=" #rrggbb" or " color name"

Deprecated. Sets the default color for all the non-hyperlink and unstyled text in the document. Color is specified in hexadecimal RGB values or by standard web color name.


vlink=" #rrggbb" or " color name"

Deprecated. Sets the color of the visited links (links that have already been followed) for the document. Color is specified in hexadecimal RGB values or by standard web color name.

br

 <br /> 

Inserts a line break in the content. This is one of the few presentational elements preserved in the XHTML 1.0 Strict and XHTML 1.1 DTDs.

Attributes

Core(id, class, style, title)


clear="none|left|right|all"

Deprecated. Specifies where the next line should appear after the line break in relation to floated elements (such as an image that has been floated to the left or right margin). The default, none, causes the next line to start where it would normally. The value left starts the next line below any floated objects on the left margin. Similarly, right starts the next line below floated objects on the right margin. The value all starts the next line below floats on both margins.

button

 <button>...</button> 

Defines a "button" that functions similarly to buttons created with the input element but allows for richer rendering possibilities. Buttons can contain content such as text and images (but not image maps).

Attributes

Core(id, class, style, title), Internationalization, Events, Focus(accesskey, tabindex, onfocus, onblur)


disabled="disabled"

Indicates that the form button is initially nonfunctional.


name=" text"

Required. Assigns the control name for the element.


value=" text"

Assigns the value to the button control. The behavior of the button is determined by the type attribute.


type="submit|reset|button"

Identifies the type of button: submit button (the default type), reset button, or custom button (used with JavaScript), respectively.

caption

 <caption>...</caption> 

Provides a brief summary of the table's contents or purpose. The caption must immediately follow the table start tag and precede all other table elements. The width of the caption is determined by the width of the table. The caption's position as displayed in the browser can be controlled with the align attribute.

Attributes

Core(id, class, style, title), Internationalization, Events


align="top|bottom|left|right"

Deprecated. Positions the caption relative to the table. The default is top.

center

 <center>...</center> 

Deprecated. Centers its contents horizontally in the available width of the page or the containing element. It has been deprecated in favor of style sheets for alignment.

Attributes

Core(id, class, style, title), Internationalization, Events

cite

 <cite>...</cite> 

Denotes a citationa reference to another document, especially books, magazines, articles, and so on.

Attributes

Core(id, class, style, title), Internationalization, Events

code

 <code>...</code> 

Denotes a program code sample. By default, code is rendered in the browser's specified monospace font (usually Courier).

Attributes

Core(id, class, style, title), Internationalization, Events

col

 <col /> 

Specifies properties for a column (or group of columns) within a column group (colgroup). Columns can share attributes (such as text alignment) without being part of a formal structural grouping.

Attributes

Core(id, class, style, title), Internationalization, Events


span=" number"

Specifies the number of columns "spanned" by the col element. The default value is 1. All columns indicated in the span are formatted according to the attribute settings in col.


width=" pixels, percentage, n*"

Specifies the width of each column spanned by the col element. Width can be measured in pixels or percentages, or defined as a relative size (*). For example, 2* sets the column two times wider than the other columns; 0* sets the column width at the minimum necessary to hold the column's contents. The width attribute in the col element overrides the width settings of the containing colgroup element.

colgroup

 <colgroup>...</colgroup> 

Creates a column group: a structural division within a table. A table may include more than one column group. The number of columns in a group is specified either by the value of the span attribute or by a tally of columns (col) within the group.

Column groups may be useful in speeding table display (for example, the columns can be displayed incrementally without waiting for the entire contents of the table) and provide a system for display on nonvisual display agents such as speech- and Braille-based browsers.

Attributes

Core(id, class, style, title), Internationalization, Events


span=" number"

Specifies the number of columns in a column group. If span is not specified, the default is 1.


width=" pixels, percentage, n*"

Specifies a default width for each column in the current column group. Width can be measured in pixels, percentages, or defined as a relative size (*). 0* sets the column width at the minimum necessary to hold the column's contents.

dd

 <dd>...</dd> 

Denotes the definition portion of an item within a definition list.

Attributes

Core(id, class, style, title), Internationalization, Events

del

 <del>...</del> 

Indicates deleted text. It may be useful for legal documents and any instance where edits need to be tracked. Its counterpart is inserted text (<ins>). Both can be used to indicate either inline or block-level elements.

Attributes

Core(id, class, style, title), Internationalization, Events


cite=" URL"

Can be set to point to a source document that explains why the document was changed.


datetime=" YYYY-MM-DDThh:mm:ssTZD"

Specifies the date and time the change was made. Dates and times follow the format listed above where YYYY is the four-digit year, MM is the two-digit month, DD is the day, hh is the hour (00 through 23), mm is the minute (00 through 59), and ss is the seconds (00 through 59). The TZD stands for Time Zone Designator and its value can be Z (to indicate UTC, Coordinated Universal Time), an indication of the number of hours and minutes ahead of UTC (such as +03:00), or an indication of the number of hours and minutes behind UTC (such as -02:20).

This is the standard format for date and time values in HTML. For more information, see www.w3.org/TR/1998/NOTE-datetime-19980827.

dfn

 <dfn>...</dfn> 

Indicates the defining instance of the enclosed term. It can be used to call attention to the introduction of special terms and phrases.

Attributes

Core(id, class, style, title), Internationalization, Events

dir

 <dir>...</dir> 

Deprecated. Creates a directory list consisting of list items (li). Directory lists were originally designed to display lists of files with short names, but they have been deprecated with the recommendation that unordered lists (ul) be used instead. Most browsers render directory lists as they do unordered lists (with bullets), although some use a multicolumn format.

Attributes

Core(id, class, style, title), Internationalization, Events


compact

Deprecated. Makes the list as small as possible. Few browsers support the compact attribute.

div

 <div>...</div> 

Denotes a generic "division" within the document. This element is used to add a customizable block element to the document. The content within the div element is typically given a name via a class or id attribute and then formatted with style sheets.

Attributes

Core(id, class, style, title), Internationalization, Events


align="center|left|right"

Deprecated. Aligns the text within the element to the left, right, or center of the page.

Example

 <div >Content of sidebar...</div> 

dl

 <dl>...</dl> 

Indicates a definition list, consisting of terms (dt) and definitions (dd).

Attributes

Core(id, class, style, title), Internationalization, Events


compact

Deprecated. Makes the list as small as possible. Few browsers support the compact attribute.

dt

 <dt>...</dt> 

Denotes the term portion of an item within a definition list.

Attributes

Core(id, class, style, title), Internationalization, Events

em

 <em>...</em> 

Indicates emphasized text. User agents generally render emphasized text in italic by default.

Attributes

Core(id, class, style, title), Internationalization, Events

embed

 <embed>...</embed> or <embed /> 

Nonstandard. Embeds an object into the web page. Embedded objects are most often multimedia files that require special plug-ins to display (for example, Flash movies, QuickTime movies, and the like). In addition to the attributes listed below, certain media types and their respective plug-ins may have proprietary attributes for controlling the playback of the file. The closing tag is not always required, but is recommended.

The W3C recommends the object element for embedding media objects, but embed is still in common use for backward compatibility. If you want the browser to prompt for a missing plug-in, you might need to break conformance and use embed. Many developers use both object and embed for a single media object.

Attributes


align="left|right|top|bottom"

NN 4.0+ and MSIE 4.0+ only. Controls the alignment of the media object relative to the surrounding text. The default is bottom. While top and bottom are vertical alignments, left and right position the object on the left or right margin and allow text to wrap around it.


height=" number"

Specifies the height of the object in number of pixels. Some media types require this attribute.


hidden="yes|no"

Hides the media file or player from view when set to yes. The default is no.


name=" text"

Specifies a name for the embedded object. This is particularly useful for referencing the object from a script.


palette="foreground|background"

NN 4.0+ and MSIE 4.0+ only. This attribute applies to the Windows platform only. A value of foreground makes the plug-in's palette the foreground palette. Conversely, a value of background makes the plug-in use the background palette; this is the default.


pluginspage=" URL"

NN 4.0+ and MSIE 4.0+ only. Specifies the URL for information on installing the appropriate plug-in.


src=" URL"

Required. Provides the URL to the file or object to be placed on the page.


width=" number"

Specifies the width of the object in number of pixels. Some media types require this attribute.

Internet Explorer only


alt=" text"

Provides alternative text when the media object cannot be displayed (same as for the img element).


code=" filename"

Specifies the class name of the Java code to be executed.


codebase=" URL"

Specifies the base URL for the application.


units="pixels|en"

Defines the measurement units used by height and width. The default is pixels. En units are half the point size of the body text.

Netscape Navigator only


border=" number"

Specifies the width of the border (in pixels) around the media object.


frameborder="yes|no"

Turns the border on or off.


hspace=" number"

Used in conjunction with the align attribute, the horizontal space attribute specifies (in pixels) the amount of space to leave clear to the left and right of the media object.


pluginurl=" URL"

Specifies a source for installing the appropriate plug-in for the media file. Netscape recommends that you use pluginurl instead of pluginspage.


type=" media (MIME) type"

Specifies the MIME type of the media in order to load the appropriate plug-in. Navigator uses either the value of the type attribute or the suffix of the filename given as the source to determine which plug-in to use.


vspace=" number"

Used in conjunction with the align attribute, the vertical space attribute specifies (in pixels) the amount of space to leave clear above and below the media object.

fieldset

 <fieldset>...</fieldset> 

Groups related form controls and labels. Fieldset elements are placed within the form element. It is similar to div but is specifically for grouping fields. It was introduced to improve form accessibility to users with alternative browsing devices.

Attributes

Core(id, class, style, title), Internationalization, Events

font

 <font>...</font> 

Deprecated. Used to affect the style (color, typeface, and size) of the enclosed text.

Attributes

Core(id, class, style, title), Internationalization


color=" #RRGGBB" or " color name"

Deprecated. Specifies the color of the enclosed text. For information on how to specify color, see Appendix D.


face=" typeface" (or list of typefaces)

Deprecated. Specifies a typeface for the text. The specified typeface is used only if it is found on the user's machine. You may provide a list of fonts (separated by commas), and the browser uses the first available in the string.


size=" value"

Deprecated. Sets the size of the type to an absolute value on a scale from 1 to 7 (3 is the default), or by using a relative value +n or -n (based on the default or basefont setting).

form

 <form>...</form> 

Indicates an interactive form that contains controls for collecting user input and other page content. There can be more than one form in an HTML document, but forms cannot be nested inside one another, and it is important that they do not overlap.

Attributes

Core(id, class, style, title), Internationalization, Events, (plus onsubmit, onblur)


accept=" content-type-list"

Specifies a comma-separated list of file types (MIME types) that the server will accept and is able to process. Browsers may one day be able to filter out unacceptable files when prompting a user to upload files to the server, but this attribute is not yet widely supported.


accept-charset=" charset list"

Specifies the list of character encodings for input data that must be accepted by the server to process the current form. The value is a space- and/or comma-delimited list of ISO character set names. The default value is unknown. This attribute is not widely supported.


action=" URL"

Required. Specifies the URL of the application that will process the form. The default is the current URL.


enctype=" content type"

Specifies how the values for the form controls are encoded when they are submitted to the server when the method is post. The default is the Internet Media Type (application/x-www-form-urlencoded). The value multipart/form-data should be used in combination with the file input element.


method="get|post"

Specifies which HTTP method will be used to submit the form data. With get (the default), the information is appended to and sent along with the URL itself.


name=" text"

Deprecated in XHTML 1.0; useid instead. Assigns a name to the form.


target=" name"

Specifies a target for the results of the form submission to be loaded so results of a form can be displayed in another window or frame. The special target values _bottom, _top, _parent, and _self may be used.

frame

 <frame /> 

Defines a single frame within a frameset.

Attributes

Core(id, class, style, title)


bordercolor="#rrggbb" or " color name"

Nonstandard. Sets the color for a frame's borders (if the border is turned on). Support for this attribute is limited to Netscape 3.0+ and Internet Explorer 4.0+.


frameborder="1|0" (IE 3+ and W3C Rec.); "yes|no" (NN 3+)

Determines whether there is a 3D separator drawn between the current frame and surrounding frames. A value of 1 turns the border on. A value of 0 turns the border off. The default value is 1 (border on). Netscape also accepts the values 1 and 0.


longdesc =" URL"

Specifies a link to a document containing a long description of the frame and its contents. Although longdesc is included in the HTML 4.01 and XHTML 4.0 Recommendations, no browsers currently support it.


marginwidth=" number"

Specifies the amount of space (in pixels) between the left and right edges of the frame and its contents. The minimum value according to the HTML specification is 1 pixel. Setting the value to 0 to place objects flush against the edge of the frame works in some browsers but may yield inconsistent results.


marginheight=" number"

Specifies the amount of space (in pixels) between the top and bottom edges of the frame and its contents. The minimum value according to the HTML specification is 1 pixel. Setting the value to 0 to place objects flush against the edge of the frame works in some browsers but may yield inconsistent results.


name=" text"

Deprecated in XHTML 1.0; useid instead. Assigns a name to the frame. This name may be referenced by targets within links to make the target document load within the named frame.


noresize="noresize"

Prevents users from resizing the frame. By default, despite specific frame size settings, users can resize a frame by clicking and dragging its borders.


scrolling="yes|no|auto"

Specifies whether scrollbars appear in the frame. A value of yes means scrollbars always appear; a value of no means scrollbars never appear; a value of auto (the default) means scrollbars appear automatically when the contents do not fit within the frame.


src=" URL"

Specifies the location of the initial HTML file to be displayed by the frame.

frameset

 <frameset>...</frameset> 

Defines a collection of frames or other framesets.

Attributes

Core(id, class, style, title), onload, onunload


border=" number"

Nonstandard. Sets frame border thickness (in pixels) between all the frames in a frameset (when the frame border is turned on). Mozilla browsers do not support border.


bordercolor=" #rrggbb" or " color name"

Nonstandard. Sets a border color for all the borders in a frameset. Mozilla and Opera browsers do not support bordercolor.


cols=" list of lengths" (number, percentage, or *)

Establishes the number and sizes of columns (vertical frames) in a frameset. The number of columns is determined by the number of values in the list. Size specifications can be in absolute pixel values, percentage values, or relative values (*) based on available space.


frameborder="1|0"; "yes|no"

Nonstandard. Determines whether 3D separators are drawn between frames in the frameset. A value of 1 (or yes) turns the borders on; 0 (or no) turns the borders off. Netscape also supports values of 1 and 0. The Frameset DTD does not include the frameborder attribute for the frameset element.


rows=" list of lengths" ( number, percentage, or *)

Establishes the number and size of rows (horizontal frames) in the frameset. The value is a comma-separated list of measurements. The number of rows is determined by the number of values in the list. Size specifications can be in absolute pixel values, percentage values, or relative values (*) based on available space.

h1, h2, h3, h4, h5, h6

 <hn>...</hn> 

Specifies a heading that briefly describes the section it introduces. There are six levels of headings, from h1 (most important) to h6 (least important).

Attributes

Core(id, class, style, title), Internationalization, Events


align="center|left|right"

Deprecated. Used to align the header left, right, or centered on the page. Microsoft Internet Explorer 3.0 and earlier does not support right alignment.

head

 <head>...</head> 

Defines the head (also called the "header") portion of the document that contains information about the document that is not considered document content. The head element serves as a container for the other header elements, such as title, base, link, and meta.

Attributes

Internationalization(lang, xml:lang, dir)


profile=" URLs"

Provides the location of one or more predefined metadata profiles separated by whitespace that are used to define properties and values that can be referenced by meta elements in the head of the document, rel and rev attributes, and class names. This attribute is not yet implemented by browsers.

hr

 <hr /> 

Adds a horizontal rule to the page that can be used as a divider between sections of content. This is an example of a presentational HTML element. A rule between sections of a document may be better handled using a border on the top or bottom edge of a block element.

Attributes

Core(id, class, style, title), Internationalization, Events


align="center|left|right"

Deprecated. If the rule is shorter than the width of the window, this attribute controls horizontal alignment of the rule. The default is center.


noshade="noshade"

Deprecated. This displays the rule as a solid bar with no shading.


size=" number"

Deprecated. Specifies the thickness of the rule in pixels.


width=" number" or " number%"

Deprecated. Specifies the length of the rule in pixels or as a percentage of the page width. By default, rules are the full width of the browser window.

html

 <html>...</html> 

This is the root element of an HTML document, meaning all other elements are contained within it. The html element has no ancestors. Placed at the beginning and end of the document, this element indicates that the entire document is HTML or XHTML.

Attributes

Internationalization(lang, xml:lang, dir)


xmlns="http://www.w3.org/1999/xhtml"

Required; XHTML only. In an XHTML document, this declares the XML namespace for the document.


version="-//W3C//DTD HTML 4.01//EN"

Deprecated in HTML 4.01. In HTML, the value of version is a Formal Public Identifier (FPI) that specifies the version of HTML the document uses (the value above specifies 4.01). In HTML 4.01, the version attribute is deprecated because it is redundant with information provided in the DOCTYPE declaration. In XHTML 1.0, the value of version has not been defined.

i

 <i>...</i> 

Enclosed text is displayed in italic. It is discouraged from use in favor of the more semantic em (emphasized) element. This is one of the few presentational elements preserved in the XHTML 1.0 Strict and XHTML 1.1 DTDs.

Attributes

Core(id, class, style, title), Internationalization, Events

iframe

 <iframe>...</iframe> 

Defines an inline (floating) frame within a document. An iframe displays the content of an external document and may display scrolling devices if the content doesn't fit in the specified window area. Inline frames are positioned similarly to images.

Attributes

Core(id, class, style, title)


align="top|middle|bottom|left|right"

Deprecated. Aligns the inline frame on the page within the flow of the text. Left and right alignment allows text to flow around the inline frame.


frameborder="1|0"

Turns on or off the display of a 3D border for the inline frame. The default is 1, which displays the border.


height=" number"

Specifies the height of the inline frame in pixels or as a percentage of the window size. Internet Explorer and Navigator use a default height of 150 pixels.


hspace=" number"

Nonstandard. Used in conjunction with left and right alignment, this attribute specifies the amount of space (in pixels) to hold clear to the left and right of the inline frame.


longdesc=" URL"

Specifies a link to a document containing a long description of the inline frame and its contents. This addition to the HTML 4.01 specification may be useful for nonvisual web browsers.


marginheight=" number"

Specifies the amount of space (in pixels) between the top and bottom edges of the inline frame and its contents.


marginwidth=" number"

Specifies the amount of space (in pixels) between the left and right edges of the inline frame and its contents.


name=" text"

Deprecated in XHTML 1.0. Assigns a name to the inline frame to be referenced by targeted links.


scrolling="yes|no|auto"

Specifies whether scrollbars appear in the frame. A value of yes means scrollbars always appear; a value of no means scrollbars never appear; a value of auto (the default) means scrollbars appear automatically when the contents do not fit within the frame.


src=" URL"

Specifies the URL of the HTML document to display initially in the inline frame.


vspace=" number"

Nonstandard. Used in conjunction with left and right alignment, this attribute specifies the amount of space (in pixels) to hold clear above and below the inline frame.


width=" number"

Specifies the width of the inline frame in pixels or as a percentage of the window size. Internet Explorer and Navigator use a default width of 300 pixels.

img

 <img /> 

Places an image on the page.

Attributes

Core(id, class, style, title), Internationalization, Events


align=" type"

Deprecated. Specifies the alignment of an image using one of the following values:

Type

Resulting alignment

bottom

Aligns the bottom of the image with the text baseline. This is the default vertical alignment.

left

Aligns the image on the left margin and allows subsequent text to wrap around it.

middle

Aligns the text baseline with the middle of the image.

right

Aligns the image on the right margin and allows subsequent text to wrap around it.

top

Aligns the top of the image with the top of the tallest object on that line.



alt=" text"

Required. Provides a string of alternative text that appears when the image is not displayed. Internet Explorer 4.0+ and Netscape 6 on Windows display this text as a "tool tip" when the mouse rests on the image.


border=" number"

Deprecated.Specifies the width (in pixels) of the border that surrounds a linked image.


height=" number"

Specifies the height of the image in pixels. It is not required, but is recommended to speed up the rendering of the web page.


hspace=" number"

Deprecated. Specifies (in number of pixels) the amount of space to leave clear to the left and right of the image.


ismap

Indicates that the graphic is used as the basis for a server-side image map (an image containing multiple hypertext links).


longdesc=" URL"

Specifies a link to a long description of the image or an image map's contents. This may be used to make information about the image accessible to nonvisual browsers. It is supported only by Netscape 6 as of this writing.


lowsrc=" URL"

Nonstandard. Specifies an image (usually of a smaller file size) that will download first, followed by the final image specified by the src attribute.


name=" text"

Deprecated in XHTML 1.0; useid instead. Assigns the image element a name so it can be referred to by a script or style sheet.


src=" URL"

Required. Provides the location of the graphic file to be displayed.


usemap=" URL"

Specifies the map containing coordinates and links for a client-side image map (an image containing multiple hypertext links).


vspace=" number"

Deprecated.Specifies (in number of pixels) the amount of space to leave clear above and below the image.


width=" number"

Specifies the width of the image in pixels. It is not required, but is recommended to speed up the rendering of the web page.

input

 <input /> 

The input element is used to create a variety of form input controls. The type of control is defined by the type attribute. Following is a complete list of attributes (with descriptions) that can be used with the input element. Not all attributes can be used with all control types. The attributes associated with each control type are also provided.

Attributes

Core(id, class, style, title), Internationalization, Events (onfocus, onblur, onselect, onchange


alt=" text"

Specifies alternative text for an image used as a button.


accept=" MIME type"

Specifies a comma-separated list of content types that a server processing the form will handle correctly. It can be used to filter out nonconforming files when prompting a user to select files to send to the server.


accesskey=" character"

Assigns an access key (keyboard shortcut) to an element for quicker access.


checked="checked"

When this attribute is added, a checkbox will be checked by default.


disabled="disabled"

Disables the control for user input. It can only be altered via a script. Browsers may display disabled controls differently (grayed out, for example), which could be useful for dimming certain controls until required info is supplied.


maxlength=" number"

Specifies the maximum number of characters the user can input for this element.


name=" text"

Required by all input types exceptsubmit and reset. Assigns a name to the control. A script program uses this name to reference the control.


readonly="readonly"

Indicates that the form input may not be modified.


size=" number"

Specifies the size of a text-entry box (measured in number of characters). Users can type entries that are longer than the space provided, causing the field to scroll to the right.


src=" URL"

Provides the URL of an image used as a push button.


tabindex=" number"

Specifies position in the tabbing order. Tabbing navigation allows the user to cycle through the active fields using the Tab key.


type="text|password|checkbox|radio|submit|reset|file|hidden|image|button"

Specifies type of form control.


value=" text"

Specifies the value for this control.

<input type="button" />

Creates a customizable "push" button. Customizable buttons have no specific behavior but can be used to trigger functions created with JavaScript controls. Data from type="button" controls is never sent with a form when a form is submitted to the server; these button controls are only for use with script programs on the browser.

Attributes

Core(id, class, style, title), Internationalization, Events, Focus(accesskey, tabindex, onfocus, onblur)

align="left|middle|right|top|bottom" (Deprecated)

disabled="disabled"

name="text" (Required)

value="text"

<input type="checkbox" />

Creates a checkbox input element within a form. Checkboxes are like on/off switches that can be toggled by the user. Several checkboxes in a group may be selected at one time. When a form is submitted, only the "on" checkboxes submit values to the server.

Attributes

Core(id, class, style, title), Internationalization, Events, Focus(accesskey, tabindex, onfocus, onblur)

align="left|middle|right|top|bottom" (Deprecated)

checked="checked"

disabled="disabled"

name="text" (Required)

readonly="readonly"

value="text" (Required)

<input type="file" />

Allows users to submit external files with their form submissions by providing a browsing mechanism in the form.

Attributes

Core(id, class, style, title), Internationalization, Events, Focus(accesskey, tabindex, onfocus, onblur)

accept="MIME type"

disabled="disabled"

maxlength="number"

name="text" (Required)

readonly="readonly"

size="number"

value="text"

<input type="hidden" />

Creates a control that does not display in the browser. Hidden controls can be used to pass special form-processing information to the server that the user cannot see or alter.

Attributes

accesskey="character"

tabindex="number"

name="text" (Required)

value="text" (Required)

<input type="image" />

Allows an image to be used as a substitute for a submit button. If a type="image" button is pressed, the form is submitted.

Attributes

Core(id, class, style, title), Internationalization, Events, Focus(accesskey, tabindex, onfocus, onblur)

align="left|middle|right|top|bottom" (Deprecated)

alt="text"

disabled="disabled"

name="text" (Required)

src="URL"

<input type="password" />

Creates a text-input element (like <input type="text">), but the input text is rendered in a way that hides the characters, such as by displaying a string of asterisks (*) or bullets (•). Note that this does not encrypt the information entered and should not be considered to be a real security measure.

Attributes

Core(id, class, style, title), Internationalization, Events, Focus(accesskey, tabindex, onfocus, onblur)

disabled="disabled"

maxlength="number"

name="text" (Required)

readonly="readonly"

size="number"

value="text" (Required)

<input type="radio" />

Creates a radio button that can be turned on and off. When a group of radio buttons share the same control name, only one button within the group can be "on" at one time, and all the others are "off." This makes them different from checkboxes, which allow multiple choices to be selected within a group. Only data from the "on" radio button is sent when the form is submitted.

Attributes

Core(id, class, style, title), Internationalization, Events, Focus(accesskey, tabindex, onfocus, onblur)

checked="checked"

disabled="disabled"

name="text" (Required)

readonly="readonly"

value="text" (Required)

<input type="reset" />

Creates a reset button that clears the contents of the elements in a form (or sets them to their default values).

Attributes

Core(id, class, style, title), Internationalization, Events, Focus(accesskey, tabindex, onfocus, onblur)

disabled="disabled"

name="text"

value="text"

<input type="submit" />

Creates a submit button control; pressing the button immediately sends the information in the form to the server for processing.

Attributes

Core(id, class, style, title), Internationalization, Events, Focus(accesskey, tabindex, onfocus, onblur)

disabled="disabled"

name="text"

value="text"

<input type="text" />

Creates a text input element. This is the default input type, as well as the most useful and common.

Attributes

Core(id, class, style, title), Internationalization, Events, Focus(accesskey, tabindex, onfocus, onblur)

disabled="disabled"

maxlength="number"

name="text" (Required)

readonly="readonly"

size="number"

value="text"

ins

 <ins>...</ins> 

Indicates text that has been inserted into the document. It may be useful for legal documents and any instance in which edits need to be tracked. Its counterpart is deleted text (del). Both can be used to indicate either inline or block-level elements.

Attributes

Core(id, class, style, title), Internationalization, Events


cite=" URL"

Can be set to point to a source document that explains why the document was changed.


datetime=" YYYY-MM-DDThh:mm:ssTZD"

Specifies the date and time the change was made. See del for an explanation of the date/time format.

isindex

 <isindex /> 

Deprecated.Marks the document as searchable. The server on which the document is located must have a search engine that supports this searching. The browser displays a text entry field and a generic line that says, "This is a searchable index. Enter search keywords." This method is outdated; more sophisticated searches can be handled with form elements and CGI scripting.

The isindex element is not part of the form system and does not need to be contained within a form element.

Attributes

Core(id, class, style, title), Internationalization


prompt=" text"

Provides alternate text (not the default) to be used as a query by the user.

kbd

 <kbd>...</kbd> 

Stands for "keyboard" and indicates text entered by the user.

Attributes

Core(id, class, style, title), Internationalization, Events

label

 <label>...</label> 

Used to attach information to controls. Each label element is associated with exactly one form control.

Attributes

Core(id, class, style, title), Internationalization, Events, onfocus, onblur


accesskey=" character"

Assigns an access key (keyboard shortcut) to an element for quicker access.


for=" text"

Explicitly associates the label with the control by matching the value of the for attribute with the value of the id attribute within the control element.

Example

 <label for="lastname">Last Name: </label> <input type="text"  size="32" /> 

legend

 <legend>...</legend> 

Assigns a caption to a fieldset (it must be contained within a fieldset element). This improves accessibility when the fieldset is rendered nonvisually.

Attributes

Core(id, class, style, title), Internationalization, Events


accesskey=" character"

Assigns an access key (keyboard shortcut) to an element for quicker access.


align="top|bottom|left|right"

Deprecated. Aligns the text relative to the fieldset.

li

 <li>...</li> 

Defines an item in a list. It is used within the ol, ul, menu (deprecated), and dir (deprecated) list elements.

Attributes

Core(id, class, style, title), Internationalization, Events


type=" format"

Deprecated. Changes the format of the automatically generated numbers or bullets for list items.

Within unordered lists (ul), the type attribute can be used to specify the bullet style (disc, circle, or square) for a particular list item.

Within ordered lists (ol), the type attribute specifies the numbering style (see options under the ol listing) for a particular list item.


start=" number"

Nonstandard. Within ordered lists, you can specify the first number in the number sequence.


value=" number"

Deprecated. Within ordered lists, you can specify the number of an item. Following list items increase from the specified number.

link

 <link /> 

Defines the relationship between the current document and another document. Although it can signify such relationships as index, next, and previous, it is most often used to link a document to an external style sheet.

Attributes

Core(id, class, style, title), Internationalization, Events


charset=" charset"

Specifies the character encoding of the target document. See Chapter 6 for information on character sets.


href=" URL"

Identifies the target document.


hreflang=" language code"

HTML 4.01.Specifies the base language of the target document. See Chapter 6 for a list of two-letter language codes.


media="all|screen|print|handheld|projection|tty|tv|projection|braille|aural"

Identifies the target medium for the linked document so an alternate style sheet can be accessed. The media attribute is explained in more detail in Chapters 16 and 36.


rel=" relationships"

Describes one or more relationships from the current source document to the target. Common relationship types include stylesheet, next, prev, copyright, index, and glossary.


rev=" relationships"

Specifies one or more relationships of the target document back to the source (the opposite of the rel attribute).


target =" name"

Defines the default target window for all links in the document. Often used to target frames.


type=" resource"

Shows the media or content type of an outside link. The value text/css indicates that the linked document is an external Cascading Style Sheet.

map

 <map>...</map> 

Specifies a client-side image map. It contains some number of area elements that establish clickable regions within the image map. The map must be named using the name attribute in HTML documents, the id attribute in XHTML documents, or both for backwards-compatibility.

Attributes

Core(id, class, style, title), Internationalization, Events


docPubcolor">"

Required. Gives the map a unique name so it can be referenced from a link, script, or style sheet. This attribute is required in the XHTML 1.0 & 1.1 Recommendations.


name=" text"

Deprecated in XHTML 1.0 only; useid instead. Gives the image map a name that is then referenced within the img element. This attribute is required in HTML.

menu

 <menu>...</menu> 

Deprecated. This indicates a menu list, which consists of list items li. Menus are intended to be used for a list of short choices, such as a menu of links to other documents. It is little used and has been deprecated in favor of ul.

Attributes

Core(id, class, style, title), Internationalization, Events


compact

Deprecated. Displays the list as small as possible (not many browsers do anything with this attribute).

meta

 <meta /> 

Provides additional information about the document. It should be placed within the head of the document. It is commonly used to identify the media type and character set for a document. It can also provide keywords, author information, descriptions, and other metadata.

Attributes

Internationalization(lang, xml:lang, dir)


content=" text"

Required. Specifies the value of the meta element property and is always used in conjunction with name or http-equiv.


http-equiv=" text"

The specified information is treated as though it were included in the HTTP header that the server sends ahead of the document. It is used in conjunction with the content attribute (in place of the name attribute).


name=" text"

Specifies a name for the meta information property.


scheme=" text"

Provides additional information for the interpretation of metadata.

noembed

 <noembed>...</noembed> 

Nonstandard. The text or object specified by noembed appears when an embedded object cannot be displayed (such as when the appropriate plug-in is not available). This element is used within or beside the embed element.

noframes

 <noframes>...</noframes> 

Defines content to be displayed by browsers that cannot display frames. Browsers that do support frames ignore the content in the noframes element.

Attributes

Core(id, class, style, title), Internationalization, Events

noscript

 <noscript>...</noscript> 

Provides alternate content when a script cannot be executed. The content of this element may be rendered if the user agent doesn't support scripting, if scripting support is turned off, or if the browser doesn't recognize the scripting language.

Attributes

Core(id, class, style, title), Internationalization, Events

object

 <object>...</object> 

A generic element used for placing an object (such as an image, applet, or media file) on a web page. The attributes required for the object element vary with the type of content it is placing. The object element may also contain a number of param elements that pass important information to the object when it displays or plays. Not all objects require additional parameters. The declare, standby, and tabindex attributes are not universally supported. Browsers vary in support of some media types placed with the object element.

Attributes

Core(id, class, style, title), Internationalization, Events


align="baseline|center|left|middle|right|textbottom|textmiddle|texttop"

Deprecated. Aligns object with respect to surrounding text. See the img element for explanations of the align values.


archive=" URLs"

Specifies a space-separated list of URLs for resources that are related to the object.


border=" number"

Deprecated. Sets the width of the border in pixels if the object is a link.


classdocPubcolor">"

Identifies the location of an object's implementation. It is used with or in place of the data attribute. The syntax depends on the object type. Not supported by Gecko browsers.


codebase=" URL"

Identifies the base URL used to resolve relative URLs in the object (similar to base). By default, codebase is the base URL of the current document.


codetype=" codetype"

Specifies the media type of the code. It is required only if the browser cannot determine an applet's MIME type from the classid attribute or if the server does not deliver the correct MIME type when downloading the object.


data=" URL"

Specifies the URL of the data used for the object. The syntax depends on the object.


declare="declare"

Declares an object but restrains the browser from downloading and processing it. Used in conjunction with the name attribute, this facility is similar to a forward declaration in a more conventional programming language, letting you defer the download until the object actually gets used.


height=" number"

Specifies the height of the object in pixels.


hspace=" number"

Deprecated. Holds number pixels of space clear to the left and right of the object.


name=" text"

Specifies the name of the object to be referenced by scripts on the page. Removed from the XHTML 1.1 Recommendation in favor of the id attribute.


standby=" message"

Specifies the message to display during object loading.


tabindex=" number"

Specifies the position of the current element in the tabbing order for the current document. The value must be between 0 and 32767. It is used for tabbing through the links on a page (or fields in a form).


type=" type"

Specifies the media type for the data.


usemap=" URL"

Specifies the image map to use with the object.


vspace=" number"

Deprecated. Holds number pixels of space clear above and below the object.


width=" number"

Specifies the object width in pixels.

ol

 <ol>...</ol> 

Defines an ordered (numbered) list, which consists of list items (li). The browser inserts item numbers automatically.

Attributes

Core(id, class, style, title), Internationalization, Events


compact

Deprecated. Displays the list as small as possible (not many browsers do anything with this attribute).


start=" number"

Deprecated. Starts the numbering of the list at number instead of at 1.


type="1|A|a|I|i"

Deprecated. Defines the numbering system for the list shown next.

Type value

Generated style

Sample sequence

1

Arabic numerals (default)

1, 2, 3, 4

A

Uppercase letters

A, B, C, D

a

Lowercase letters

a, b, c, d

I

Uppercase Roman numerals

I, II, III, IV

i

Lowercase Roman numerals

i, ii, iii, iv


optgroup

 <optgroup>...</optgroup> 

Defines a logical group of options elements. This could be used by browsers to display hierarchical cascading menus. An optgroup element cannot contain other optgroup elements (they cannot be nested).

Attributes

Core(id, class, style, title), Internationalization, Events


disabled=" disabled"

Indicates that the group of options is nonfunctional. It can be reactivated with a script.


label=" text"

Required. Specifies the label for the option group.

option

 <option>...</option> 

Defines an option within a select element (a multiple-choice menu or scrolling list). The content of the option element is the value that is sent to the form processing application (unless an alternative value is specified using the value attribute).

Attributes

Core(id, class, style, title), Internationalization, Events


disabled=" disabled"

Indicates that the selection is initially nonfunctional. It can be reactivated with a script.


label=" text"

Allows the author to provide a shorter label than the content of the option. This attribute is not supported.


selected=" selected"

Makes this item selected when the form is initially displayed.


value=" text"

Defines a value to assign to the option item within the select control, to use in place of option contents.

p

 <p>...</p> 

Denotes a paragraph. Browsers are instructed to ignore multiple empty p elements.

Attributes

Core(id, class, style, title), Internationalization, Events


align="center|left|right"

Deprecated. Aligns the text within the element to the left, right, or center of the page.

param

 <param /> 

Supplies a parameter within an applet or object element.

Attributes


docPubcolor">"

Provides a name (similar to the name attribute) so it can be referenced from a link, script, or style sheet. It is more versatile than name, but it is not as universally supported.


name=" text"

Required. Defines the name of the parameter.


value=" text"

Defines the value of the parameter.


valuetype="data|ref|object"

Indicates the type of value: data indicates that the parameter's value is data (default); ref indicates that the parameter's value is a URL; object indicates that the value is the URL of another object in the document.


type=" content type"

HTML 4.01. Specifies the media type of the resource only when the valuetype attribute is set to ref. It describes the types of values found at the referred location.

pre

 <pre>...</pre> 

Delimits preformatted text, meaning that lines are displayed exactly as they are typed in, honoring whitespace such as multiple character spaces and line breaks. By default, text within a pre element is displayed in a monospace font such as Courier.

Attributes

Core(id, class, style, title), Internationalization, Events


width =" number"

Deprecated. This optional attribute determines how many characters to fit on a single line within the pre block.

q

 <q>...</q> 

Delimits a short quotation that can be included inline, such as "to be or not to be." It differs from blockquote, which is a block-level element used for longer quotations. Some browsers automatically insert quotation marks. When used with the lang (language) attribute, the browser may insert language-specific quotation marks.

Attributes

Core(id, class, style, title), Internationalization, Events


cite=" url"

Designates the source document from which the quotation was taken.

s

 <s>...</s> 

Deprecated. Enclosed text is displayed as strike-through text (same as strike but introduced by later browser versions).

Attributes

Core(id, class, style, title), Internationalization, Events

samp

 <samp>...</samp> 

Delimits sample output from programs, scripts, and so on. Sample text is generally displayed in a monospace font.

Attributes

Core(id, class, style, title), Internationalization, Events

script

 <script>...</script> 

Places a script in the document (usually JavaScript for web documents). It may appear any number of times in the head or body of the document. The script may be provided in the script element or in an external file (by providing the src attribute).

Attributes


charset=" character set"

Indicates the character encoding of an external script document (it is not relevant to the content of the script element)


defer="defer"

Indicates to the user agent that the script will not generate document content, so the user agent may continue rendering.


language=" text"

Deprecated. Provides the name of the scripting language, but since it is not standardized, it has been deprecated in favor of the type attribute.


src=" url"

Provides the location of an external script.


type=" content-type"

Required. Specifies the scripting language used for the current script. This setting overrides any default script setting for the document. The value is a content type, most often text/javascript.

select

 <select>...</select> 

Defines a multiple-choice menu or a scrolling list. It is a container for one or more option elements. This element may also contain one or more optgroup elements.

Attributes

Core(id, class, style, title), Internationalization, Events, onfocus, onblur, onchange


disabled="disabled"

Indicates that the select element is initially nonfunctional. It can be reactivated with a script.


multiple="multiple"

This allows the user to select more than one option from the list. When this attribute is absent, only single selections are allowed.


name=" text"

Required. Defines the name for select control; when the form is submitted to the form-processing application, this name is sent along with each selected option value.


size=" number"

Specifies the number of rows that display in the list of options. For values higher than 1, the options are displayed as a scrolling list with the specified number of options visible. When size=1 is specified, the list is displayed as a pop-up menu.

The default value is 1 when multiple is not used. When multiple is specified, the value varies by browser (but a value of 4 is common).


tabindex=" number"

Specifies position in the tabbing order. Tabbing navigation allows the user to cycle through the active fields by using the Tab key.

small

 <small>...</small> 

Renders the type smaller than the surrounding text.

Attributes

Core(id, class, style, title), Internationalization, Events

span

 <span>...</span> 

Identifies a generic inline element. It can be used in conjunction with the class and/or id attributes and formatted with Cascading Style Sheets.

Attributes

Core(id, class, style, title), Internationalization, Events

strike

 <strike>...</strike> 

Deprecated. Enclosed text is displayed as strikethrough text (crossed through with a horizontal line). It has been deprecated in favor of style sheet controls.

Attributes

Core(id, class, style, title), Internationalization, Events

strong

 <strong>...</strong> 

Enclosed text is strongly emphasized. User agents generally render strong elements in bold.

Attributes

Core(id, class, style, title), Internationalization, Events

style

 <style>...</style> 

Inserts style sheet rules into the head of a document. The minimum markup for embedding a Cascading Style Sheet is:

 <style type="text/css">...</style> 

Attributes

Internationalization(lang, dir, xml:lang)


media="all|aural|braille|handheld|print|projection|screen|tty|tv"

Specifies the intended destination medium for the style information. It may be a single keyword or a comma-separated list. The default is screen.


title=" text"

Gives the embedded style sheet a title.


type=" content type" (text/css)

Required.Specifies the style sheet language. For Cascading Style Sheets (currently the only style type option), the value is text/css.

sub

 <sub>...</sub> 

Formats enclosed text as subscript.

Attributes

Core(id, class, style, title), Internationalization, Events

sup

 <sup>...</sup> 

Formats enclosed text as superscript.

Attributes

Core(id, class, style, title), Internationalization, Events

table

 <table>...</table> 

Indicates a table. The end tag is required, and its omission may cause the table not to render in some browsers.

Attributes

Core(id, class, style, title), Internationalization, Events


align="left|right|center"

Deprecated. Aligns the table within the text flow (same as align in the img element). The default alignment is left. The center value is not universally supported.


bgcolor=" #rrggbb" or " color name"

Deprecated. Specifies a background color for the entire table. Value is specified in hexadecimal RGB values or by color name. (See Appendix D for more information on specifying colors in HTML.)


border=" number"

Specifies the width (in pixels) of the border around the table and its cells. Setting its value to 0 (zero) turns the borders off completely. The default value is 1. Adding the word border without a value results in a 1-pixel border, although this is not valid in XHTML.


cellpadding=" number"

Sets the amount of space, in number of pixels, between the cell border and its contents. The default value is 1.


cellspacing=" number"

Sets the amount of space (in number of pixels) between table cells. The default value is 2.


frame="void|above|below|hsides|lhs|rhs|vsides|box|border"

Tells the browser where to draw borders around the table. The values are as follows:

Value

Description

void

The frame does not appear (default).

above

Top side only.

below

Bottom side only.

hsides

Top and bottom sides only.

vsides

Right and left sides only.

lhs

Left side only.

rhs

Right side only.

box

All four sides.

border

All four sides.


When the border attribute is set to a value greater than zero, the frame defaults to border unless otherwise specified.


height=" number, percentage"

Nonstandard. Specifies the minimum height of the entire table. It can be specified in a specific number of pixels or by a percentage of the parent element.


rules="all|cols|groups|none|rows"

Tells the browser where to draw rules within the table. Its values are as follows:

Value

Description

none

No rules (default).

groups

Rules appear between row groups (thead, tfoot, and tbody) and column groups.

rows

Rules appear between rows only.

cols

Rules appear between columns only.

all

Rules appear between all rows and columns.


When the border attribute is set to a value greater than zero, rules defaults to all unless otherwise specified.

This attribute was introduced by Internet Explorer 3.0 and now appears in the HTML 4.01 specification. Netscape supports it in Version 6t only.


summary=" text"

Provides a summary of the table contents for use with nonvisual browsers.


width=" number, percentage"

Specifies the width of the entire table. It can be specified by number of pixels or by percentage of the parent element.

tbody

 <tbody>...</tbody> 

Defines a row or group of rows as the "body" of the table. It must contain at least one row element (tr). "Row group" elements (tbody, thead, and tfoot) could speed table display and provide a mechanism for scrolling the body of a table independently of its head and foot. Row groups could also be useful for printing long tables for which the head information could be printed on each page. The char and charoff attributes are not supported by current commercial browsers.

Attributes

Core(id, class, style, title), Internationalization, Events


align="left|right|center|justify|char"

Specifies the horizontal alignment of text in a cell or cells. The default value is left. The align attribute as it applies to table cell content has not been deprecated and appears in the Tables Module of the XHTML 1.1 Recommendation.


char=" character"

Specifies a character along which the cell contents will be aligned when align is set to char. The default character is a decimal point (language-appropriate). This attribute is generally not supported by current browsers.


charoff=" length"

Specifies the offset distance to the first alignment character on each line. If a line doesn't use an alignment character, it should be horizontally shifted to end at the alignment position. This attribute is generally not supported by current browsers.


valign="top|middle|bottom|baseline"

Specifies the vertical alignment of text in the cells of a column. The valign attribute as it applies to table cell content has not been deprecated and appears in the Tables Module of the XHTML 1.1 Recommendation.

td

 <td>...</td> 

Defines a table data cell. The end tag is not required in HTML markup but may prevent unpredictable table display, particularly if the cell contains images. The end tag is required in XHTML for the document to be valid. A table cell can contain any content, including another table.

Attributes

Core(id, class, style, title), Internationalization, Events


abbr=" text"

Provides an abbreviated form of the cell's content.


align="left|right|center|justify|char"

Specifies the horizontal alignment of text in a cell or cells. The default value is left. The align attribute as it applies to table cell content has not been deprecated and appears in the Tables Module of the XHTML 1.1 Recommendation.


axis=" text"

Places a cell into a conceptual category, which could then be used to organize or search the table in different ways.


background=" url"

Nonstandard. Specifies a graphic image to be used as a tile within the cell.


bgcolor=" #rrggbb" or " color name"

Deprecated. Specifies a color to be used in the table cell. A cell's background color overrides colors specified at the row or table levels.


char=" character"

Specifies a character along which the cell contents will be aligned when align is set to char. The default character is a decimal point (language-appropriate). This attribute is generally not supported by current browsers.


charoff=" length"

Specifies the offset distance to the first alignment character on each line. If a line doesn't use an alignment character, it should be horizontally shifted to end at the alignment position. This attribute is generally not supported by current browsers.


colspan=" number"

Specifies the number of columns the current cell should span. The default value is 1. According to the HTML 4.01 specification, the value zero (0) means the current cell spans all columns from the current column to the last column in the table; in reality, however, this feature is not supported in current browsers.


headers=" id reference"

Lists header cells (by id) that provide header information for the current data cell. This is intended to make tables more accessible to nonvisual browsers.


height=" pixels, percentage"

Deprecated. Specifies the height of the cell in number of pixels or by a percentage value relative to the table height. The height specified in the first column will apply to the rest of the cells in the row. The height values need to be consistent for cells in a particular row. Pixel measurements are more reliable than percentages, which work only when the height of the table is specified in pixels.


nowrap="nowrap"

Deprecated. Disables automatic text wrapping for the current cell. Line breaks must be added with a <br> or by starting a new paragraph.


rowspan=" number"

Specifies the number of rows spanned by the current cell. The default value is 1. According to the HTML 4.01 Recommendation, the value zero (0) means the current cell spans all rows from the current row to the last row; in reality, however, this feature is not supported by browsers.


scope="row|col|rowgroup|colgroup"

Specifies the table cells for which the current cell provides header information. A value of col indicates that the current cell is the header for all the cells that fall below. colgroup indicates the current cell is the header for the column group that contains it. A value of row means that the current cell is the header for the cells in the rest of the row. A value of rowgroup means the current cell is the header for the containing row group. This is intended to make tables more accessible to nonvisual browsers.


valign="top|middle|bottom|baseline"

Specifies the vertical alignment of text in the cells of a column. The valign attribute as it applies to table cell content has not been deprecated and appears in the Tables Module of the XHTML 1.1 Recommendation.


width=" pixels, percentage"

Deprecated. Specifies the width of the cell in number of pixels or by a percentage value relative to the table width. The width specified in the first row will apply to the rest of the cells in the column, and the values need to be consistent for cells in the column.

textarea

 <textarea>...</textarea> 

Defines a multiline text-entry control. The content of the textarea element is displayed in the text-entry field when the form initially displays.

Core(id, class, style, title), Internationalization, Events, onselect, onchange, Focus(accesskey, tabindex, onfocus, onblur)


cols=" number"

Required. Specifies the visible width of the text-entry field, measured in number of characters. Users may enter text lines that are longer than the provided width, in which case the entry scrolls to the right (or wraps if the browser provides some mechanism for doing so).


disabled="disabled"

Disables the control for user input. It can only be altered via a script. Browsers may display disabled controls differently (grayed out, for example), which could be useful for dimming certain controls until required info is supplied.


name=" text"

Required. Specifies a name for the text input control. This name will be sent along with the control content to the form-processing application.


readonly="readonly"

Indicates that the form control may not be modified.


rows=" number"

Required. Specifies the height of the text-entry field in number of lines of text. If the user enters more lines than are visible, the text field scrolls down to accommodate the extra lines.

tfoot

 <tfoot>...</tfoot> 

Defines the foot of a table. It is one of the "row group" elements. A tfoot element must contain at least one row (tr).

Attributes

See tbody for more information and a list of supported attributes.

th

 <th>...</th> 

Defines a table header cell. Table header cells provide important information and context to the table cells in the row or column that they precede. They are a key tool for making the information in tables accessible. In terms of markup, they function the same as table data cells (TD).

Attributes

The th element accepts the same attributes as the TD element. See listing under td.

thead

 <thead>...</thead> 

Defines the head of the table and should contain information about a table. It is used to duplicate headers when the full table is broken over pages, or for a static header that appears with a scrolling table body. It must contain at least one row (tr). The thead element is one of the "row group" elements.

Attributes

See tbody for more information and a list of supported attributes.

title

 <title>...</title> 

Required. Specifies the title of the document. The title generally appears in the top bar of the browser window. According to the HTML 4.01 and XHTML specifications, all documents must contain a meaningful title within the head of the document.

Attributes

Internationalization(lang, xml:lang, dir)

tr

 <tr>...</tr> 

Defines a row of cells within a table. A table row element contains no content other than a collection of table cells (td). Settings made in the tr element apply to all the cells in that row, but individual cell settings override those made at the row level.

Attributes

Core(id, class, style, title), Internationalization, Events


align="left|right|center|justify|char"

Specifies the horizontal alignment of text in a cell or cells. The default value is left. The align attribute as it applies to table cell content has not been deprecated and appears in the Tables Module of the XHTML 1.1 Recommendation.


bgcolor="# rrggbb" or " color name"

Deprecated. Specifies a color to be used in the row. A row's background color overrides the color specified at the table level.


char=" character"

Specifies a character along which the cell contents will be aligned when align is set to char. The default character is a decimal point (language-appropriate). This attribute is generally not supported by current browsers.


charoff=" length"

Specifies the offset distance to the first alignment character on each line. If a line doesn't use an alignment character, it should be horizontally shifted to end at the alignment position. This attribute is generally not supported by current browsers.


valign="top|middle|bottom|baseline"

Specifies the vertical alignment of text in the cells of a column. The valign attribute as it applies to table cell content has not been deprecated and appears in the Tables Module of the XHTML 1.1 Recommendation.

tt

 <tt>...</tt> 

Formats enclosed text as teletype text. The text enclosed in the tt element is generally displayed in a monospace font such as Courier.

Attributes

Core(id, class, style, title), Internationalization, Events

u

 <u>...</u> 

Deprecated. Enclosed text is underlined when displayed. The HTML 4.01 specification prefers style sheet controls for this effect.

Attributes

Core(id, class, style, title), Internationalization, Events

ul

 <ul>...</ul> 

Defines an unordered list, in which list items (li) have no sequence. By default, browsers insert bullets before each item in a bulleted list, lists may be formatted in any fashion (including as horizontal navigation elements) using Cascading Style Sheet properties.

Attributes

Core(id, class, style, title), Internationalization, Events


compact="compact"

Deprecated. Displays the list block as small as possible. Not many browsers support this attribute.


type="disc|circle|square"

Deprecated. Defines the shape of the bullets used for each list item.

var

 <var>...</var> 

Indicates an instance of a variable or program argument, usually rendered in italics.

Attributes

Core(id, class, style, title), Internationalization, Events




Web Design in a Nutshell
Web Design in a Nutshell: A Desktop Quick Reference (In a Nutshell (OReilly))
ISBN: 0596009879
EAN: 2147483647
Year: 2006
Pages: 325

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net