HTML & XHTML: The Complete Reference (Osborne Complete Reference Series)

 <  Day Day Up  >  

<button> - <dfn>

<button> (Form Button)

This element defines a nameable region known as a button, which can be used together with scripts.

Standard Syntax

<button accesskey="key" class="class name(s)" dir="ltr rtl" disabled="disabled" id="unique alphanumeric identifier" lang="language code" name="button name" tabindex="number" title="advisory text" type="button reset submit" value="button value"> </button>

Attributes Defined by Internet Explorer

contenteditable="false true inherit" (5.5) datafld="name of column supplying bound data" (4) dataformatas="html text" (4) datasrc="id of data source object supplying data" (4) hidefocus="true false" (5.5) language="javascript jscript vbs vbscript" (4) unselectable="on off" (5.5)

Standard Events

onclick, ondblclick, onmousedown, onmouseup, onmouseover, onmousemove, onmouseout, onkeypress, onkeydown, onkeyup

Events Defined by Internet Explorer

onactivate, onafterupdate, onbeforeactivate, onbeforecut, onbeforedeactivate, onbeforeeditfocus, onbeforepaste, onbeforeupdate, onblur, oncontextmenu, oncontrolselect, oncut, ondeactivate, ondragenter, ondragleave, ondragover, ondrop, onerrorupdate, onfilterchange, onfocus, onfocusin, onfocusout, onhelp, onlosecapture, onmouseenter, onmouseleave, onmousewheel, onmove, onmoveend, onmovestart, onpaste, onpropertychange, onreadystatechange, onresize, onresizeend, onresizestart, onselectstart

Element-Specific Attributes

accesskey       This attribute specifies a keyboard navigation accelerator for the element. Pressing ALT or a similar key in association with the specified key selects the anchor element correlated with that key.

datafld       This Internet Explorer-specific attribute specifies the column name from the data source object that supplies the bound data that defines the information for the <button> tag's content.

dataformatas       This Internet Explorer-specific attribute indicates whether the bound data is plain text or HTML.

datasrc       This Internet Explorer-specific attribute indicates the id of the data source object that supplies the data that is bound to the <button> tag.

disabled       This attribute is used to disable the button.

name       This attribute is used to define a name for the button so that it can be scripted by older browsers or used to provide a name for submit buttons when there is more than one in a page.

tabindex       This attribute uses a number to identify the object's position in the tabbing order.

type       This attribute defines the action of the button. Possible values include button , reset , and submit , which are used to indicate that the button is a plain button, form reset button, or form submission button, respectively. The XHTML specification suggests submit is the default, but browsers may not enforce this in practice.

value       Defines the value that is sent to the server when the button is clicked. This might be useful when using multiple submit buttons that perform different actions to indicate which button was pressed to the handling server-side program.

Examples

<button name="Submit" value="Submit" type="Submit"> Submit Request </button> <button type="button" onclick="doSomething()"> Click This Button </button> <button type="button"> <img src="polkadot.gif" alt="Polkadot"></button>

Compatibility

HTML 4, 4.01 XHTML 1.0, 1.1

Internet Explorer 4, 5, 4.5, 5.5, 6 Netscape 6, 7 Opera 5-7

Notes

<caption> (Table Caption)

This element is used within the table element to define a caption.

Standard Syntax

<caption align="bottom left right top" (transitional only) class="class name(s)" dir="ltr rtl" id="unique alphanumeric identifier" lang="language code" title="advisory text"> </caption>

Attributes Defined by Internet Explorer

accesskey="key" (5.5) contenteditable="false true inherit" (5.5) hidefocus="true false" (5.5) language="javascript jscript vbs vbscript" (4) tabindex="number" (5.5) unselectable="on off" (5.5) valign="bottom top" (4)

Standard Events

onclick, ondblclick, onmousedown, onmouseup, onmouseover, onmousemove, onmouseout, onkeypress, onkeydown, onkeyup

Events Defined by Internet Explorer

onactivate, onbeforeactivate, onbeforecopy, onbeforecut, onbeforedeactivate, onbeforeeditfocus, onbeforepaste, onblur, oncontextmenu, oncontrolselect, oncopy, oncut, ondeactivate, ondrag, ondragend, ondragenter, ondragleave, ondragover, ondragstart, ondrop, onfocus, onfocusin, onfocusout, onhelp, onlosecapture, onmouseenter, onmouseleave, onmousewheel, onmove, onmoveend, onmovestart, onpaste, onpropertychange, onreadystatechange, onresizeend, onresizestart, onselectstart, ontimeerror

Element-Specific Attributes

align       This attribute specifies the alignment of the caption. HTML 4 defines bottom , left , right , and top as legal values. Internet Explorer also supports center . Because this does not provide the possibility to combine vertical and horizontal alignments, Microsoft has introduced the valign attribute for the caption element.

valign       This Internet Explorer-specific attribute specifies whether the table caption appears at the top or bottom . The default is top.

Example

<table> <caption align="top"> Our High-Priced Menu </caption> <tr> <td> Escargot </td> <td> Filet Mignon </td> <td> Big Mac </td> </tr> </table>

Compatibility

HTML 3.2, 4, 4.01 XHTML 1.0, 1.1, Basic

Internet Explorer 4, 5, 5.5, 6 Netscape 3, 4, 4.5-4.8, 6, 7 Opera 4-7

Notes

<center> (Center Alignment)

This element causes the enclosed content to be centered within the margins currently in effect. Margins are either the default page margins or those imposed by overriding elements, such as tables.

Standard Syntax (Transitional Only)

<center class="class name(s)" dir="ltr rtl" id="unique alphanumeric identifier" lang="language code" title="advisory text"> </center>

Attributes Defined by Internet Explorer

accesskey="key" (5.5) contenteditable="false true inherit" (5.5) disabled="false true" (5.5) hidefocus="true false" (5.5) language="javascript jscript vbs vbscript" (4) tabindex="number" (5.5) unselectable="on off" (5.5)

Standard Events

onclick, ondblclick, onmousedown, onmouseup, onmouseover, onmousemove, onmouseout, onkeypress, onkeydown, onkeyup

Events Defined by Internet Explorer

onactivate, onbeforeactivate, onbeforecopy, onbeforecut, onbeforedeactivate, onbeforeeditfocus, onbeforepaste, onblur, oncontextmenu, oncontrolselect, oncopy, oncut, ondeactivate, ondrag, ondragend, ondragenter, ondragleave, ondragover, ondragstart, ondrop, onfocus, onfocusin, onfocusout, onhelp, onlosecapture, onmouseenter, onmouseleave, onmousewheel, onmove, onmoveend, onmovestart, onpaste, onpropertychange, onreadystatechange, onresizeend, onresizestart, onselectstart, ontimeerror

Example

<center> This is in the center of the page. </center>

Compatibility

HTML 3.2, 4, 4.01 (transitional) XHTML 1.0 (transitional)

Internet Explorer 2, 3, 4, 5, 5.5, 6 Netscape 1, 2, 3, 4, 4.5-4.8, 6, 7 Opera 4-7

Notes

<cite> (Citation)

This element indicates a citation from a book or other published source and usually is rendered in italics by a browser.

Standard Syntax

<cite class="class name(s)" dir="ltr rtl" id="unique alphanumeric identifier" lang="language code" title="advisory text"> </cite>

Attributes Defined by Internet Explorer

accesskey="key" (5.5) contenteditable="false true inherit" (5.5) disabled="false true" (5.5) hidefocus="true false" (5.5) language="javascript jscript vbs vbscript" (4) tabindex="number" (5.5) unselectable="on off" (5.5)

Standard Events

onclick, ondblclick, onmousedown, onmouseup, onmouseover, onmousemove, onmouseout, onkeypress, onkeydown, onkeyup

Events Defined by Internet Explorer

onactivate, onbeforeactivate, onbeforecopy, onbeforecut, onbeforedeactivate, onbeforeeditfocus, onbeforepaste, onblur, oncontextmenu, oncontrolselect, oncopy, oncut, ondeactivate, ondrag, ondragend, ondragenter, ondragleave, ondragover, ondragstart, ondrop, onfocus, onfocusin, onfocusout, onhelp, onlosecapture, onmouseenter, onmouseleave, onmousewheel, onmove, onmoveend, onmovestart, onpaste, onpropertychange, onreadystatechange, onresizeend, onresizestart, onselectstart, ontimeerror

Example

This example is taken from <cite> HTML: The Complete Reference </cite>.

Compatibility

HTML 2, 3.2, 4, 4.01 XHTML 1.0, 1.1, Basic

Internet Explorer 2, 3, 4, 5, 5.5, 6 Netscape 1, 2, 3, 4, 4.5-4.8, 6, 7 Opera 4-7

Notes

HTML 2 and 3.2 do not indicate any attributes for this element.

<code> (Code Listing)

This element indicates that the enclosed text is source code in a programming language. Usually, it is rendered in a monospaced font.

Standard Syntax

<code class="class name(s)" dir="ltr rtl" id="unique alphanumeric identifier" lang="language code" title="advisory text"> </code>

Attributes Defined by Internet Explorer

contenteditable="false true inherit" (5.5) disabled="false true" (5.5) language="javascript jscript vbs vbscript" (4) unselectable="on off" (5.5)

Standard Events

onclick, ondblclick, onmousedown, onmouseup, onmouseover, onmousemove, onmouseout, onkeypress, onkeydown, onkeyup

Events Defined by Internet Explorer

onactivate, onbeforeactivate, onbeforecopy, onbeforecut, onbeforedeactivate, onbeforeeditfocus, onbeforepaste, onblur, oncontextmenu, oncontrolselect, oncopy, oncut, ondeactivate, ondrag, ondragend, ondragenter, ondragleave, ondragover, ondragstart, ondrop, onfocus, onfocusin, onfocusout, onhelp, onlosecapture, onmouseenter, onmouseleave, onmousewheel, onmove, onmoveend, onmovestart, onpaste, onpropertychange, onreadystatechange, onresizeend, onresizestart, onselectstart, ontimeerror

Example

To increment a variable called count , use <code> count++ </code>

Compatibility

HTML 2, 3.2, 4, 4.01 XHTML 1.0, 1.1, Basic

Internet Explorer 2, 3, 4, 5, 5.5, 6 Netscape 1, 2, 3, 4, 4.5-4.8, 6, 7 Opera 4-7

Notes

<col> (Table Column)

This element defines a column within a table and is used for grouping and alignment purposes. It generally is found within a colgroup element.

Standard Syntax

<col align="center char justify left right" char="character" charoff="number" class="class name(s)" dir="ltr rtl" id="unique alphanumeric identifier" lang="language code" span="number" title="advisory text" valign="baseline bottom middle top" width="column width specification" />

Attributes Defined by Internet Explorer

bgcolor="color name #RRGGBB" (5.5)

Standard Events

onclick, ondblclick, onmousedown, onmouseup, onmouseover, onmousemove, onmouseout, onkeypress, onkeydown, onkeyup

Events Defined by Internet Explorer

onlayoutcomplete, onreadystatechange

Element-Specific Attributes

align       This attribute specifies horizontal alignment of a cell 's contents.

bgcolor       This Internet Explorer-specific attribute sets the background color for the column. Its value can be either a browser-dependent named color or a color specified using the hexadecimal #RRGGBB format.

char       This attribute is used to set the character on which the cells in a column should be aligned. A typical value for this is a period (.) for aligning numbers or monetary values.

charoff       This attribute is used to indicate the number of characters by which the column data should be offset from the alignment characters specified by the char value.

span       When present, this attribute applies the attributes of the col element to additional consecutive columns .

valign       This attribute specifies the vertical alignment of the text within the cell. Possible values for this attribute are baseline , bottom , middle , and top .

width       This attribute specifies a default width for each column in the current column group . In addition to the standard pixel and percentage values, this attribute might take the special form 0* , which means that the width of each column in the group should be the minimum width necessary to hold the column's contents.

Example

<table border="1" width="400"> <colgroup> <col align="center" width="150" /> <col align="right" /> <tr> </colgroup> <td> This column is aligned to the center. </td> <td> This one is aligned to the right. </td> </tr> <tr><td>!</td><td>?</td></tr> <tr><td>!</td><td>?</td></tr> </table>

Compatibility

HTML 4, 4.01 XHTML 1.0, 1.1

Internet Explorer 4, 5, 5.5, 6 Netscape 6, 7 Opera 7

Notes

<colgroup> (Table Column Group)

This element creates an explicit group of table columns to allow group level scripting or formatting.

Standard Syntax

<colgroup align="center char justify left right" char="character" charoff="number" class="class name(s)" dir="ltr rtl" id="unique alphanumeric identifier" lang="language code" span="number" title="advisory text" valign="baseline bottom middle top" width="column width specification"> col elements only </colgroup>

Attributes Defined by Internet Explorer

bgcolor="color name #RRGGBB" (5.5)

Standard Events

onclick, ondblclick, onmousedown, onmouseup, onmouseover, onmousemove, onmouseout, onkeypress, onkeydown, onkeyup

Events Defined by Internet Explorer

onreadystatechange

Element-Specific Attributes

align       This attribute specifies horizontal alignment of the contents of the cells in the column group. The values of center , left , and right have obvious meanings. A value of justify for the attribute should attempt to justify all the column's contents. A value of char attempts to align the contents based on the value of the char attribute in conjunction with charoff .

bgcolor       This Internet Explorer-specific attribute sets the background color for the columns in the column group. Its value can be either a browser-dependent named color or a color specified using the hexadecimal #RRGGBB format.

char       This attribute is used to set the character on which the cells in a column should be aligned. A typical value for this attribute is a period (.) for aligning numbers or monetary values.

charoff       This attribute is used to indicate the number of characters by which the column data should be offset from the alignment characters specified by the char value.

span       When present, this attribute specifies the default number of columns in this group. Browsers should ignore this attribute if the current column group contains one or more <col> tags. The default value of this attribute is 1 .

valign       This attribute specifies the vertical alignment of the contents of the cells within the column group.

width       This attribute specifies a default width for each column and its cells in the current column group. In addition to the standard pixel and percentage values, this attribute can take the special form 0* , which means that the width of each column in the group should be the minimum width necessary to hold the column's contents.

Examples

<colgroup span="2" align="char" char=":" valign="center"> <col /><col /><col /> </colgroup> <colgroup > <col align="left" /> <col align="center" /> </colgroup>

Compatibility

HTML 4, 4.01 XHTML 1.0, 1.1

Internet Explorer 4, 5, 5.5, 6 Netscape 6, 7 Opera 7

Notes

<comment> (Comment Information)

This nonstandard element treats enclosed text as comments. This element should not be used.

Syntax Defined by Internet Explorer

<comment data="URL" (6) id="unique alphanumeric identifier" (4) lang="language code" (4) title="advisory text"> (4) </comment>

Events Defined by Internet Explorer

onpropertychange, onreadystatechange

Element-Specific Attributes

data       References a URL that contains the comment information.

Example

<comment> This is not the proper way to form comments!!! </comment>

Compatibility

No standards

Internet Explorer 4, 5, 5.5, 6

Notes

<dd> (Definition in a Definition List)

This element indicates the definition of a term within a list of defined terms ( <dt> ) enclosed by a definition list ( <dl> ).

Standard Syntax

<dd class="class name(s)" dir="ltr rtl" id="unique alphanumeric identifier" lang="language code" title="advisory text"> </dd>

Attributes Defined by Internet Explorer

accesskey="key" (5.5) contenteditable="false true inherit" (5.5) disabled="false true" (5.5) hidefocus="true false" (5.5) language="javascript jscript vbs vbscript" (4) nowrap="no yes" (4) tabindex="number" (5.5) unselectable="on off" (5.5)

Standard Events

onclick, ondblclick, onmousedown, onmouseup, onmouseover, onmousemove, onmouseout, onkeypress, onkeydown, onkeyup

Events Defined by Internet Explorer

onactivate, onbeforeactivate, onbeforecopy, onbeforecut, onbeforedeactivate, onbeforeeditfocus, onbeforepaste, onblur, oncontextmenu, oncontrolselect, oncopy, oncut, ondeactivate, ondrag, ondragend, ondragenter, ondragleave, ondragover, ondragstart, ondrop, onfocus, onfocusin, onfocusout, onhelp, onlosecapture, onmouseenter, onmouseleave, onmousewheel, onmove, onmoveend, onmovestart, onpaste, onpropertychange, onreadystatechange, onresizeend, onresizestart, onselectstart, ontimeerror

Element-Specific Attributes

nowrap       This Internet Explorer-specific attribute is used to control the wrapping of text within a <dd> tag. If set to yes , text should not wrap. The default is no . CSS rules should be used instead of this attribute.

Example

<dl> <dt> DOG </dt> <dd> A domesticated animal that craves attention all the time</dd> <dt> CAT </dt> <dd> An animal that would just as soon ignore you until it gets hungry </dd> </dl>

Compatibility

HTML 2, 3.2, 4, 4.01 XHTML 1.0, 1.1, Basic

Internet Explorer 2, 3, 4, 5, 5.5, 6 Netscape 1, 2, 3, 4, 4.5-4.8, 6, 7 Opera 4-7

Notes

<del> (Deleted Text)

This element is used to indicate that text has been deleted from a document. A browser might render deleted text as strikethrough text.

Standard Syntax

<del cite="url" class="class name(s)" datetime="date" dir="ltr rtl" id="unique alphanumeric identifier" lang="language code" title="advisory text"> </del>

Attributes Defined by Internet Explorer

accesskey="key" (5.5) contenteditable="false true inherit" (5.5) disabled="false true" (5.5) language="javascript jscript vbs vbscript" (4) tabindex="number" (5.5) unselectable="on off" (5.5)

Standard Events

onclick, ondblclick, onmousedown, onmouseup, onmouseover, onmousemove, onmouseout, onkeypress, onkeydown, onkeyup

Events Defined by Internet Explorer

onbeforeeditfocus, onblur, ondrag, ondragend, ondragenter, ondragleave, ondragover, ondragstart, ondrop, onfocus, onreadystatechange, onselectstart, ontimeerror

Element-Specific Attributes

cite       The value of this attribute is a URL that designates a source document or message that might give a reason that the information was deleted.

datetime       This attribute is used to indicate the date and time the deletion was made. The value of the attribute is a date in a special format as defined by ISO 8601. The basic date format is

YYYY-MM-DDThh:mm:ssTZD

where the following is true:

YYYY=four-digit year such as 1999 MM=two-digit month (01=January, 02=February, and so on.) DD=two-digit day of the month (01 through 31) hh=two digit hour (00 to 23) (24-hour clock, not AM or PM) mm=two digit minute (00 through 59) ss=two digit second (00 through 59) TZD=time zone designator

The time zone designator is either Z , which indicates Universal Time Coordinate or coordinated universal time format (UTC), or + hh : mm , which indicates that the time is a local time that is hh hours and mm minutes ahead of UTC. Alternatively, the format for the time zone designator could be - hh : mm , which indicates that the local time is behind UTC. Note that the letter "T" actually appears in the string, all digits must be used, and 00 values for minutes and seconds might be required. An example value for the datetime attribute might be 1999-10-6T09:15:00-05:00 , which corresponds to October 6, 1999, 9:15 A.M., U.S. Eastern Standard Time.

Example

<del cite="http://www.bigcompany.com/changes/oct97.htm" datetime="1998-10-06T09:15:00-05:00"> The penalty clause applies to client lateness as well. </del>

Compatibility

HTML 4, 4.01 XHTML 1.0, 1.1

Internet Explorer 4, 5, 5.5, 6 Netscape 6, 7 Opera 7

Notes

<dfn> (Definition)

This element encloses the defining instance of a term. It usually is rendered as bold or bold italic text.

Standard Syntax

<dfn class="class name(s)" dir="ltr rtl" id="unique alphanumeric identifier" lang="language code" title="advisory text"> </dfn >

Attributes Defined by Internet Explorer

accesskey="key" (5.5) contenteditable="false true inherit" (5.5) disabled="false true" (5.5) hidefocus="true false" (5.5) language="javascript jscript vbs vbscript" (4) tabindex="number" (5.5) unselectable="on off" (5.5)

Standard Events

onclick, ondblclick, onmousedown, onmouseup, onmouseover, onmousemove, onmouseout, onkeypress, onkeydown, onkeyup

Events Defined by Internet Explorer

onactivate, onbeforeactivate, onbeforecopy, onbeforecut, onbeforedeactivate, onbeforeeditfocus, onbeforepaste, onblur, oncontextmenu, oncontrolselect, oncopy, oncut, ondeactivate, ondrag, ondragend, ondragenter, ondragleave, ondragover, ondragstart, ondrop, onfocus, onfocusin, onfocusout, onhelp, onlosecapture, onmouseenter, onmouseleave, onmousewheel, onmove, onmoveend, onmovestart, onpaste, onpropertychange, onreadystatechange, onresize, onresizeend, onresizestart, onselectstart

Example

<p> An <dfn> elephant </dfn> is too large to make a viable pet for anyone poorer than Bill Gates. </p>

Compatibility

HTML 2, 3.2, 4, 4.01 XHTML 1.1, Basic

Internet Explorer 2, 3, 4, 5, 5.5, 6 Netscape 6, 7 Opera 4-7

Notes


 <  Day Day Up  >  

Категории