| < Day Day Up > |
This element encloses a list of brief, unordered items, such as might occur in a menu or directory.
<dir
class="class name(s)"
compact="compact"
dir="ltr rtl"
id="unique alphanumeric identifier"
lang="language code"
style="style information"
title="advisory text">
li elements only
</dir>
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)
onclick, ondblclick, onmousedown, onmouseup, onmouseover, onmousemove, onmouseout, onkeypress, onkeydown, onkeyup
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
compact
This attribute
<dir> <li> Header Files </li> <li> Code Files </li> <li> Comment Files </li> </dir>
|
HTML 2, 3.2, 4, 4.01 (transitional)
|
Internet Explorer 2, 3, 4, 5, 5.5, 6
|
Because the
<dir>
tag is supposed to be used with short lists, the items in the list should have a maximum width of 20
The HTML and XHTML strict specifications do not support this element.
Most browsers will not render the <dir> tag any differently from the ul element.
HTML 2 and 3.2 define only the compact attribute.
Most browsers will not render the compact list style.
For XHTML compatibility, the compact attribute must have a value: <dir compact="compact"> .
This element indicates a generic block of document content that should be treated as a logical unit and will have no default rendering or meaning.
<div
align="center justify left right" (transitional only)
class="class name(s)"
dir="ltr rtl"
id="unique alphanumeric identifier"
lang="language code"
style="style information"
title="advisory text">
</div>
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)
onclick, ondblclick, onmousedown, onmouseup, onmouseover, onmousemove, onmouseout, onkeypress, onkeydown, onkeyup
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
align This attribute indicates how the tagged text should be horizontally aligned on the page. The default value is left .
nowrap This Internet Explorer-specific attribute is used to control the wrapping of text within a <div> tag. If set to yes , text should not wrap. The default is no . CSS rules should be used instead of this attribute.
<div align="justify"> All text within this division will be justified </div> <div class="special" id="div1" style="background: yellow;"> Divs are useful for setting arbitrary style </div>
|
HTML 3.2, 4, 4.01
|
Internet Explorer 2, 3, 4, 5, 5.5, 6
|
A
<div>
tag is a generic block tag and is very useful for binding scripts or styles to
an arbitrary section of a document. It complements
<span>
, which is used inline.
The HTML 4.01 specification specifies that the
Under the HTML 4.01 strict specification, the align attribute is not supported.
HTML 3.2 supports only the align attribute.
This element encloses a list of terms and definition pairs. A common use for this element is to implement a glossary.
<dl
class="class name(s)"
compact="compact" (transitional only)
dir="ltr rtl"
id="unique alphanumeric identifier"
lang="language code"
style="style information"
title="advisory text">
dt and dd elements only
</dl>
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)
onclick, ondblclick, onmousedown, onmouseup, onmouseover, onmousemove, onmouseout, onkeypress, onkeydown, onkeyup
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
compact This attribute reduces the white space between list items.
<dl> <dt> Cat </dt> <dd> A domestic animal that likes fish. </dd> <dt> Skunk</dt> <dd> A wild animal that needs deodorant. </dd> </dl>
|
HTML 2, 3.2, 4, 4.01
|
Internet Explorer 2, 3, 4, 5, 5.5, 6
|
The items in the list comprise two
Some page designers might use a <dl> tag or <ul> tag to create text indention. Although this is a common practice on the Web, it is not advisable because it confuses the meaning of the element by making it a physical layout device rather than a list.
HTML 2 and 3.2 support only the compact attribute for this element.
For XHTML compatibility, the compact attribute must be expanded: <dl compact="compact"> under the transitional form. It is deprecated under the strict specification.
Identifies a definition list term in a list of terms and definitions.
<dt
class="class name(s)"
dir="ltr rtl"
id="unique alphanumeric identifier"
lang="language code"
style="style information"
title="advisory text">
</dt>
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="true false" (5.5)
tabindex="number" (5.5)
unselectable="on off" (5.5)
onclick, ondblclick, onmousedown, onmouseup, onmouseover, onmousemove, onmouseout, onkeypress, onkeydown, onkeyup
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
nowrap This Internet Explorer-specific attribute is used to control the wrapping of text within a <dt> tag. If set to yes , text should not wrap. The default is no . CSS rules should be used instead of this attribute.
<dl> <dt> Vole </dt> <dd> Small creature related to the weasel </dd> <dt> Weasel </dt> <dd> Small creature related to the vole </dd> </dl>
|
HTML 2, 3.2, 4, 4.01
|
Internet Explorer 2, 3, 4, 5, 6
|
This element occurs within a list of defined terms
The close tag for the element is optional under older versions of HTML but is suggested when it will make things more clear, particularly with
Under XHTML 1.0, the closing </dt> tag is mandatory.
HTML 2 and 3.2 support no attributes for this element.
This element indicates
<em
class="class name(s)"
dir="ltr rtl"
id="unique alphanumeric identifier"
lang="language code"
style="style information"
title="advisory text">
</em>
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)
onclick, ondblclick, onmousedown, onmouseup, onmouseover, onmousemove, onmouseout, onkeypress, onkeydown, onkeyup
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
This is an <em> important point </em> to consider.
|
HTML 2, 3.2, 4, 4.01
|
Internet Explorer 2, 3, 4, 5, 5.5, 6
|
As a logical element,
em
is a prime candidate to bind style information to. For example, to define emphasis to mean a larger font
em {font-size: larger; font-family: Impact;}
HTML 2 and 3.2 support no attributes for this element.
This widely supported nonstandard element specifies an object, typically a multimedia element, to be embedded in an HTML document.
<embed
accesskey="key" (5.5)
align="absbottom absmiddle baseline bottom
left middle right texttop top" (4)
alt="alternative text" (4)
class="class name(s)" (4)
code="filename" (4)
codebase="url" (4)
height="pixels" (4)
hspace="pixels" (4)
id="unique alphanumeric identifier" (4)
language="javascript jscript vbs vbscript xml" (5.5)
name="string" (4)
src="url" (4)
style="style information" (4)
title="advisory text" (4)
unselectable="on off" (5.5)
vspace="pixels" (4)
width="pixels" (4)>
</embed>
border="pixels" (4)
hidden="true false" (4)
palette="background foreground" (4)
pluginspage="url" (4)
type="mime type" (4)
units="en pixels" (4)
onactivate, onbeforeactivate, onbeforecut, onbeforedeactivate, onbeforepaste, onblur, oncontextmenu, oncontrolselect, oncut, ondeactivate, onfocus, onfocusin, onfocusout, onhelp, onload, onlosecapture, onmouseenter, onmouseleave, onmousewheel, onmove, onmoveend, onmovestart, onpaste, onpropertychange, onreadystatechange, onresize, onresizeend, onresizestart, onscroll
align This attribute controls the alignment of adjacent text with respect to the embedded object. The default value is left .
alt This attribute indicates the text to be displayed if the included object cannot be executed.
border This attribute specifies the size in pixels of the border around the embedded object.
code
This attribute specifies the name of the file containing the compiled Java class if the
embed
element is used to include a Java applet. This is a
codebase This specifies the base URL for the plug-in or potential applet in the case of the alternative form under Internet Explorer.
height This attribute sets the height of the embedded object in pixels.
hidden If this attribute is set to the value true , the embedded object is not visible on the page and implicitly has a size of zero.
hspace
This attribute specifies, in pixels, the size of the left and right margins between the embedded object and
name This attribute specifies a name for the embedded object, which can be referenced by client-side programs in an embedded scripting language.
palette
This attribute is used only on Windows systems to select the
pluginspage This attribute contains the URL of instructions for installing the plug-in required to render the embedded object.
src This attribute specifies the URL of source content for the embedded object.
type This attribute specifies the MIME type of the embedded object. It is used by the browser to determine an appropriate plug-in for rendering the object. It can be used instead of the src attribute for plug-ins that have no content or that fetch it dynamically.
units This Netscape-specific attribute is used to set the units for measurement for the embedded object either in en or in the default, pixels .
vspace This attribute specifies, in pixels, the size of the top and bottom margins between the embedded object and surrounding text.
width This attribute sets the width, in pixels, of the embedded object.
<!-- embed without a close tag --> <embed src="testmovie.mov" height="150" width="150"> <noembed> <img src="testgif.gif" height="150" width="150" alt="Test Image"> </noembed> <!-- embed with a close tag --> <embed src="testmovie.mov" height="150" width="150"> <noembed> <img src="testgif.gif" height="150" width="150" alt="Test Image"> </noembed> </embed>
|
No standards |
Internet Explorer 3, 4, 5, 5.5, 6
|
It is actually unclear whether or not the close tag for <embed> is required. Many sites tend not to use it, and documentation is not consistent. Some people claim that a close tag is required and should surround any alternative content in a noembed element; others do not use a close tag. Whatever the case, this element should be phased out in favor of object , so this might be a moot issue.
The embed element is not favored by the W3C and is not part of any official HTML or XHTML specification; however, it is very common. The HTML specification says to use the object element, which can be used in conjunction with the embed element to provide backward compatibility. See Chapter 15 for examples.
Embedded objects are multimedia content files of arbitrary type that are rendered by browser plug-ins. The type attribute uses a file's MIME type to determine an appropriate browser plug-in. Any attributes not defined are treated as object-specific parameters and are passed through to the embedded object. Consult the plug-in or object documentation to determine these. The standard parameters supported by the Microsoft implementation are height , name , palette , src , units , and width .
This element allows form designers to
<fieldset
class="class name(s)"
dir="ltr rtl"
id="unique alphanumeric identifier"
lang="language code"
style="style information"
title="advisory text">
</fieldset>
accesskey="key" (5.5)
align="center left right" (4)
contenteditable="false true inherit" (5.5)
datafld="name of column supplying bound data" (4)
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)
onclick, ondblclick, onmousedown, onmouseup, onmouseover, onmousemove, onmouseout, onkeypress, onkeydown, onkeyup
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
align Internet Explorer defines the align attribute, which sets how the element and its contents are positioned in a table or the window.
datafld
This attribute specifies the column name from the data source object that
<fieldset> <legend>Customer Identification</legend> <br /> <label>Customer Name: <input type="text" id="CustName" size="25" /> </label> </fieldset>
|
HTML 4, 4.01
|
Internet Explorer 4, 5, 5.5, 6
|
Grouping controls makes it easier for users to understand the purposes of the controls while
The caption for a < fieldset> tag can be defined by the legend element.
The typical visual rendering of a fieldset is a boxed grouping of form fields with a label defined by the legend element.
This element allows specification of the size, color, and font of the text it encloses.
<font
class="class name(s)"
color="color name #RRGGBB"
dir="ltr rtl"
face="font name"
id="unique alphanumeric identifier"
lang="language code"
size="1 to 7 +1 to +6 -1 to -6"
style="style information"
title="advisory text">
</font>
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)
point-size="point size for font" (4)
weight="100 200 300 400 500
600 700 800 900" (4)
onactivate, onbeforeactivate, onbeforecopy, onbeforecut, onbeforedeactivate, onbeforeeditfocus, onbeforepaste, onblur, onclick, oncontextmenu, oncontrolselect, oncopy, oncut, ondeactivate, ondblclick, ondrag, ondragend, ondragenter, ondragleave, ondragover, ondragstart, ondrop, onfocus, onfocusin, onfocusout, onhelp, onkeydown, onkeypress, onkeyup, onlosecapture, onmousedown, onmouseenter, onmouseleave, onmouseout, onmouseover, onmouseup, onmousewheel, onmove, onmoveend, onmovestart, onpaste, onpropertychange, onreadystatechange, onresizeend, onresizestart, onselectstart, ontimeerror
color This attribute sets the text color using either a browser-dependent named color or a color specified in the hexadecimal #RRGGBB format.
face
This attribute contains a list of one or more font names separated by commas. The user agent looks through the specified font
point-size This Netscape 4-specific attribute specifies the point size of text and is used with downloadable fonts.
size This attribute specifies the font size as either a numeric or relative value. Numeric values range from 1 to 7 with 1 being the smallest and 3 the default. The relative values, + and - , increment or decrement the font size relative to the current size. The value for increment or decrement should range only from +1 to + 6 or - 1 to - 6 .
weight Under Netscape 4, this attribute specifies the weight of the font, with a value of 100 being lightest and 900 being heaviest.
<font color="#FF0000" face="Helvetica, Times Roman" size="+1"> Relatively large red text in Helvetica or Times. </font>
|
HTML 3.2, 4, 4.01 (transitional)
|
Internet Explorer 2, 3, 4, 5, 5.5, 6
|
Use of this element is not encouraged, as it is not part of strict HTML and XHTML specifications. Style sheets provide a cleaner way of providing the same functionality when they are supported.
Interestingly, the transitional specification for some reason does not define
The default text size for a document can be set using the size attribute of the basefont element.
The HTML 3.2 specification supports only the color and size attributes for this element.
The element defines a fill-in form that can contain labels and form controls, such as
<form
accept-charset="list of supported character sets"
action="url"
class="class name(s)"
dir="ltr rtl"
enctype="application/x-www-form-urlencoded
multipart/form-data text/plain
Media Type as per RFC 2045"
id="unique alphanumeric identifier"
lang="language code"
method="get post"
name="form's name for scripting"
style="style information"
target="_blank frame name _parent _self
_top" (transitional only)
title="advisory text">
</form>
autocomplete="yes no" (5.0)
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)
onclick, ondblclick, onmousedown, onmouseup, onmouseover, onmousemove, onmouseout, onkeypress, onkeydown, onkeyup, onreset, onsubmit
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
accept-charset This attribute specifies the list of character encodings for input data that must be accepted by the server processing the form. The value is a space- or comma-delimited list of character sets as defined in RFC 2045. The default value for this attribute is the reserved value unknown .
action This attribute contains the URL of the server program that will process the contents of the form. Some browsers also might support a mailto URL, which can mail the results to the specified address.
autocomplete This Microsoft proprietary attribute, introduced in Internet Explorer 5.0, will automatically finish filling in information that the user has previously input into an input field, and which has been encrypted and stored by the browser.
enctype
This attribute indicates how form data should be encoded before being sent to the server. The default is
application/x-www-form-urlencoded
. This encoding
method This attribute indicates how form information should be transferred to the server. The get option appends data to the URL specified by the action attribute. This approach gives the best performance but imposes a size limitation determined by the command line length supported by the server. The post option transfers data using a HTTP post transaction. This approach is more secure and imposes no data size limitation.
name This attribute specifies a name for the form and can be used by client-side programs to reference form data.
target
In documents containing frames, this attribute specifies the target frame that will display the results of a form submission. In addition to named
<form action="http://www.bigcompany.com/cgi-bin/processit.exe" method="post" name="testform" onsubmit="return validate();"> Enter your comments here: <br /> <textarea name="comments" cols="30" rows="8"> </textarea> <br /><br /> <input type="submit" value="send" /> <input type="reset" value="clear" /> </form>
|
HTML 2, 3.2, 4, 4.01
|
Internet Explorer 2, 3, 4, 5, 5.5, 6
|
Form content is defined using the <button> , <input> , <select> , and <textarea> tags, as well as other HTML formatting and structuring elements.
Special grouping elements, such as fieldset , label , and legend are provided to structure form fields, but more often tags like <div> and <table> are used to improve form layout.
HTML 2 and 3.2 support only the action , enctype , and method attributes for the form element.
This element defines a nameable window region, known as a frame, that can independently display its own content.
<frame
class="class name(s)"
frameborder="0 1"
id="unique alphanumeric identifier"
longdesc="url of description"
marginheight="pixels"
marginwidth="pixels"
name="frame name"
noresize="noresize"
scrolling="auto no yes"
src="url" of frame contents
style="style information"
title="advisory text">
allowtransparency="no yes" (5.5)
application="no yes" (5)
bordercolor="color name #RRGGBB" (4)
datafld="name of column supplying bound data" (4)
datasrc="id of data source object supplying data" (4)
frameborder="no yes 0 1" (4)
height="pixels" (4)
hidefocus="true false" (5.5)
lang="language code" (4)
language="javascript jscript vbs vbscript" (4)
security="restricted" (6)
tabindex="number" (5.5)
unselectable="on off" (5.5)
width="pixels" (4)
onactivate, onafterupdate, onbeforedeactivate, onbeforeupdate, onblur, oncontrolselect, ondeactivate, onerrorupdate, onfocus, onload, onmove, onmoveend, onmovestart, onresize, onresizeend, onresizestart
allowtransparency
This Internet Explorer-specific attribute determines whether the <
frame>
is transparent or
application
This Microsoft-specific attribute is used to
bordercolor This attribute sets the color of the frame's border using either a named color or a color specified in the hexadecimal #RRGGBB format.
datafld This Internet Explorer attribute specifies the column name from the data source object that supplies the bound data.
datasrc This Internet Explorer attribute indicates the id of the data source object that supplies the data that is bound to this element.
frameborder
This attribute determines whether the frame is
longdesc This attribute specifies the URL of a document that contains a long description of the frame's content. This attribute should be used in conjunction with the title element.
marginheight This attribute sets the height in pixels between the frame's contents and its top and bottom borders.
marginwidth This attribute sets the width in pixels between the frame's contents and its left and right borders.
name
This attribute
noresize
This attribute
fixed size.
scrolling
This attribute determines whether the frame has scroll bars. A
yes
value forces scroll bars, a
no
value prohibits them, and an
auto
value lets the browser decide. When not specified, the default value of
auto
is used. Authors are recommended to leave the value as
auto
. If you turn off scrolling and the contents end up being too large for the frame (due to rendering differences, window size, and so forth), the user will not be able to scroll to see the rest of the contents. If you
security This attribute sets the value indicating whether the source file of a frame has security restrictions applied. The only allowed value is restricted .
src This attribute contains the URL of the contents to be displayed in the frame. If it is absent, nothing will be loaded in the frame.
<frameset rows="20%,80%"> <frame src="controls.html" name="controls" noresize="noresize" scrolling="no" /> <frame src="content.html" /> </frameset>
|
HTML 4, 4.01
|
Internet Explorer 2, 3, 4, 5, 5.5, 6
|
XHTML 1.0 requires a trailing slash for this element: <frame /> .
A frame must be declared as part of a frame set by using the
<frameset>
tag, which specifies the frame's relationship to other frames on a page. A frame set occurs in a special HTML document, in which the
frameset
element replaces the
body
element. Another form of frames called
independent frames
, or
floating frames
, also is supported. Floating frames can be directly embedded in a document without
Many browsers do not support frames and require the use of the <noframes> tag.
Frames introduce potential navigation difficulties; their use should be limited to instances in which they can be shown to help navigation rather than hinder it. See Chapter 8 for more details.
| < Day Day Up > |