label - ruby

 <  Day Day Up  >  


<label> - ruby

<label> (Form Control Label)

This element is used to relate descriptions to form controls.

Standard Syntax

 <label      accesskey="key"      class="class name(s)"      dir="ltr  rtl"      for="id of form field"      id="unique alphanumeric identifier"      lang="language code"      style="style information"      title="advisory text">     </label> 

Attributes Defined by Internet Explorer

 contenteditable="false  true  inherit" (5.5)      datafld="column name" (4)      dataformatas="html  text" (4)      datasrc="data source id" (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) 

Standard Event Attributes

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

Events Defined by Internet Explorer

 onactivate, onafterupdate, onbeforeactivate, onbeforecopy, onbeforecut,  onbeforedeactivate, onbeforeeditfocus, onbeforepaste, onbeforeupdate, onblur,  oncontextmenu, oncontrolselect, oncut, ondeactivate, ondrag, ondragend,  ondragenter, ondragleave, ondragover, ondragstart, ondrop, onerrorupdate, onfocus,  onfocusin, onfocusout, onhelp, onlosecapture, onmouseenter, onmouseleave,  onmouseup, 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 attribute is used to indicate the column name in the data source that is bound to the content of a <label> tag.

dataformatas       This attribute indicates whether the bound data is plain text ( text ) or HTML ( html ). The data bound with <label> is used to set the content of the label.

datasrc       The value of this attribute is an identifier indicating the data source to pull data from.

for       This attribute specifies the id for the form control element the label references. This is optional when the label encloses the form control it is bound to. In many cases, particularly when a table is used to structure the form, a <label> tag will not be able to enclose the associated form control, so the for attribute should be used. This attribute allows more than one label to be associated with the same control by creating multiple references.

Examples

  <form action="#" method="get">   <label id="usernamelabel">Name   <input type="text" id="username" name="username" />   </label>   </form>   <form>   <table>   <tr>   <td><label for="username">Name</label></td>   <td><input type="text" id="username" name="username"></td>   </tr>   </table>   </form>  

Compatibility

HTML 4, 4.01,
XHTML 1.0, 1.1, Basic

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

Notes

  • Each <label> must not contain more than one form field.

  • The label element should not be nested.

<layer> (Positioned Layer)

This Netscape-specific element allows the definition of overlapping content layers that can be exactly positioned, hidden or shown, rendered transparent or opaque , reordered front to back, and nested. Most of the functionality of layers is available using CSS positioning facilities. Developers are strongly advised not to use the layer element.

Syntax (Defined by Netscape 4 Only)

 <layer      above="layer name"      background="URL of background image"      below="layer name"      bgcolor="color value"      class="class name(s)"      clip="clip region coordinates in x1, y1, x2, y2 form"      height="percentage  pixels"      id="unique alphanumeric identifier"      left="pixels"      name="string"      overflow="none  clip"      pagex="horizontal pixel position of layer"      pagey="vertical pixel position of layer"      src="url of layer's contents"      style="style information"      title="advisory text"      top="pixels"      visibility="hide  inherit  show"      width="percentage  pixels"      z-index="number">     </layer> 

Element-Specific Attributes

above       This attribute contains the name of the layer (as set with the name attribute) to be rendered directly above the current layer.

background       This attribute contains the URL of a background pattern for the layer. Like backgrounds for the document as a whole, the image might tile.

below       This attribute specifies the name of the layer to be rendered below the current layer.

bgcolor       This attribute specifies a layer's background color. The attribute's value can be either a named color, such as red , or a color specified in the hexadecimal #RRGGBB format, such as #FF0000 .

clip       This attribute clips a layer's content to a specified rectangle. All layer content outside that rectangle will be rendered transparent. The clip rectangle is defined by two x,y pairs that correspond to the top x , left y , bottom x , and right y coordinate of the rectangle. The coordinates are relative to the layer's origin point, 0,0 , in its top-left corner, and might have nothing to do with the pixel coordinates of the screen.

height       This attribute is used to set the height of the layer, either in pixels or as a percentage of the screen or region the layer is contained within.

left       This attribute specifies, in pixels, the left offset of the layer. The offset is relative to its parent layer, if it has one, or to the left browser margin if it does not.

name       This attribute assigns the layer a name that can be referenced by programs in a client-side scripting language. The id attribute also can be used.

overflow       This attribute specifies what should happen when the layer's content exceeds its rendering box and clipping area. A value of none does not clip the content, while clip clips the content to its dimensions or defined clipping area.

pagex       This attribute is used to set the horizontal pixel position of the layer relative to the document window rather than any enclosing layer.

pagey       This attribute is used to set the vertical pixel position of the layer relative to the document window rather than any enclosing layer.

src       This attribute specifies the URL that contains the content to be included in the layer. Using this attribute with an empty element is a good way to preserve layouts under older browsers.

top       This attribute specifies, in pixels, the top offset of the layer. The offset is relative to its parent layer if it has one, or to the top browser margin if it is not enclosed in another layer.

visibility       This attribute specifies whether a layer is hidden ( hidden ), shown ( show ), or inherits ( inherits ) its visibility from the layer enclosing it.

width       This attribute specifies a layer's width in pixels or as a percentage value of the enclosing layer or browser width.

z-index       This attribute specifies a layer's stacking order relative to other layers. Position is specified with positive integers, with 1 indicating the bottommost layer.

Examples

  <layer name="scene" bgcolor="#00FFFF>   <layer name="Shaq" left="100" top="100">   <img src="shaq.gif">   </layer>   <layer name="Rodman" left="200" top="100"   visibility="hidden">   <img src="pinkhair.gif" alt="hair">   </layer>   </layer>  <!-- The better way to do layers -->  <layer src="contents.html" left="20" top="20"   height="80%" width="80%">   </layer>  

Compatibility

No standards

Netscape 4, 4.5-4.8

Notes

  • Because this element is specific to Netscape 4, it should never be used and is discussed only for readers supporting existing <layer> -filled pages.

  • Applets, plug-ins, and other embedded media forms, generically called objects, can be included in a layer; however, they will float to the top of all other layers, even if their containing layer is obscured.

<legend> (Field Legend)

Used to assign a caption to a set of form fields as defined by a fieldset element.

Standard Syntax

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

Attributes Defined by Internet Explorer

 align="center" (4)      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 Event Attributes

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

Events Defined by Internet Explorer

 onactivate, onafterupdate, onbeforeactivate, onbeforecopy, onbeforecut,  onbeforedeactivate, onbeforeeditfocus, onbeforepaste, onblur, oncontextmenu,  oncontrolselect, oncopy, oncut, ondeactivate, onerrorupdate, onfocus, onfocusin,  onfocusout, onhelp, onlosecapture, onmouseenter, onmouseleave, onmouseup,  onmousewheel, onmove, onmoveend, onmovestart, onpaste, onpropertychange,  onreadystatechange, onresize, onresizeend, onresizestart, ontimeerror 

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 form section or the legend itself.

align       This attribute indicates where the legend value should be positioned within the border created by a <fieldset > tag. The default position for the legend is the upper-left corner. It also is possible to position the legend to the right by setting the attribute to right . The specification defines bottom and top , as well. Microsoft also defines the use of the value center .

Example

 <form action="#" method="get">  <fieldset>    <legend align="top">User Information</legend>    <label>First Name:     <input type="text" id="firstname" name="firstname" size="20" />    </label><br />    <label>Last Name:     <input type="text" id="lastname" name="lastname" size="20" />    </label><br />  </fieldset> </form> 

Compatibility

HTML 4, 4.01,
XHTML 1.0, 1.1

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

Notes

  • A <legend> tag should occur only within a <fieldset > tag. There should be only one legend per fieldset element.

  • The <legend> tag improves accessibility when the fieldset is not rendered visually.

  • Some versions of Microsoft documentation show a valign attribute for <legend> positioning. However, the valign attribute does not appear to work consistently and has since been dropped from the official documentation.

<li> (List Item)

This element is used to indicate a list item as contained in an ordered list ( <ol> ), unordered list ( <ul> ), or older list styles such as <dir > and <menu> .

Standard Syntax

 <li      class="class name(s)"      dir="ltr  rtl"      id="unique alphanumeric identifier"      lang="language code"      style="style information"      title="advisory text"      type="circle  disc  square  a  A  i  I  1"      value="number"> (value attribute transitional only)     </li> 

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 Event Attributes

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

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, onlayoutcomplete,  onlosecapture, onmouseenter, onmouseleave, onmouseup, onmousewheel, onmove,  onmoveend, onmovestart, onpaste, onpropertychange, onreadystatechange, onresize,  onresizeend, onresizestart, onselectstart, ontimeerror 

Element-Specific Attributes

type       This attribute indicates the bullet type used in unordered lists or the numbering type used in ordered lists. For ordered lists, a value of a indicates lowercase letters , A indicates uppercase letters, i indicates lowercase Roman numerals, I indicates uppercase Roman numerals, and 1 indicates numbers . For unordered lists, values are used to specify bullet types. Although the browser is free to set bullet styles, a value of disc generally specifies a filled circle, a value of circle specifies an empty circle, and a value of b specifies a filled square.

value       This attribute indicates the current number of items in an ordered list as defined by an <ol> tag. Regardless of the value of type being used to set Roman numerals or letters, the only allowed value for this attribute is a number. List items that follow will continue numbering from the value set. The value attribute has no meaning for unordered lists.

Examples

  <ul>   <li type="circle">  First list item is a circle  </li>   <li type="square">  Second list item is a square  </li>   <li type="disc"   >  Third list item is a disc  </li>   </ul>   <ol>   <li type="i">  Roman Numerals  </li>   <li type="a" value="3">  Second list item is letter C  </li>   <li type="a">  Continue list in lowercase letters  </li>   </ol>  

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.7, 6, 7
Opera 4-7

Notes

  • Under the strict HTML and XHTML definitions, the li element loses the type and value attributes, as these presentation styles can be emulated with style sheets.

  • Whereas bullet styles can be set explicitly, browsers tend to change styles for bullets when <ul> lists are nested. However, ordered lists generally do not change style automatically, nor do they support outline-style numbering (1.1, 1.1.1, and so on).

  • The closing tag </li> is optional under HTML specifications and is not commonly used. However, it is required under XHTML and should always be used.

<link> (Link to External Files or Set Relationships)

This empty element specifies relationships between the current document and other documents. Possible uses for this element include defining a relational framework for navigation and linking the document to a style sheet.

Standard Syntax

 <link      charset="charset list from RFC 2045"      class="class name(s)"      dir="ltr  rtl"      href="URL"      hreflang="language code"      id="unique alphanumeric identifier"      lang="language code"      media="all  aural  braille  print  projection               screen  other"      rel="relationship value"      rev="relationship value"      style="style information"      target="frame name" (transitional only)      title="advisory information"      type="content type" /> 

Common Attributes

 disabled="disabled "  (from DOM Level 1) 

Standard Event Attributes

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

Events Defined by Internet Explorer

 onload, onreadystatechange 

Element-Specific Attributes

charset       This attribute specifies the character set used by the linked document. Allowed values for this attribute are character set names , such as EUC-JP, as defined in RFC 2045.

disabled       This DOM Level 1 defined attribute is used to disable a link relationship. The presence of the attribute is all that is required to remove a linking relationship. In conjunction with scripting, this attribute could be used to turn on and off various style sheet relationships. It appears to be an oversight in the HTML and XHTML specifications.

href       This attribute specifies the URL of the linked resource. A URL might be absolute or relative.

hreflang       This attribute is used to indicate the language of the linked resource. See the "Language Attributes Reference" section earlier in this appendix for information on allowed values.

media       This attribute specifies the destination medium for any linked style information, as indicated when the rel attribute is set to stylesheet . The value of the attribute might be a single media descriptor, such as screen , or a comma-separated list. Possible values for this attribute include all , aural , braille , print , projection , and screen . Other values also might be defined, depending on the browser. Internet Explorer supports all , print , and screen as values for this attribute.

rel       This attribute names a relationship between the linked document and the current document. Possible values for this attribute include alternate , bookmark , chapter , contents , copyright , glossary , help , index , next , prev , section , start , stylesheet , and subsection .

The most common use of this attribute is to specify a link to an external style sheet. The rel attribute is set to stylesheet , and the href attribute is set to the URL of an external style sheet to format the page.

rev       The value of the rev attribute shows the relationship of the current document to the linked document, as defined by the href attribute. The attribute thus defines the reverse relationship compared to the value of the rel attribute. Values for the rev attribute are similar to the possible values for rel . They might include alternate , bookmark , chapter , contents , copyright , glossary , help , index , next , prev , section , start , stylesheet , and subsection .

target       The value of the target attribute defines the frame or window name that has the defined linking relationship or that will show the rendering of any linked resource.

type       This attribute is used to define the type of the content linked to. The value of the attribute should be a MIME type, such as text/html , text/css , and so on. The common use of this attribute is to define the type of style sheet linked, and the most common current value is text/css , which indicates a cascading style sheet format.

Examples

  <link href="products.html" rel="parent" />   <link href="corpstyle.css" rel="stylesheet" type="text/css" media="all" />   <link href="nextpagetoload.html" rel="next" />  

Compatibility

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

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

Notes

  • Under XHTML 1.0, empty elements such as <link> require a trailing slash: <link /> .

  • A <link> tag can occur only in the head element; however, there can be multiple occurrences of <link> .

  • HTML 3.2 defines only the href , rel , rev , and title attributes for the link element.

  • HTML 2 defines the href , methods , rel , rev , title , and urn attributes for the link element. The methods and urn attributes were later removed from the specifications.

  • The HTML and XHTML specifications define event handlers for the link element, but it is unclear how they would be used.

<listing> (Code Listing)

This deprecated element from HTML 2 is used to indicate a code listing; it is no longer part of the HTML standard. Text tends to be rendered in a smaller size within this element. The pre element should be used instead of listing to indicate preformatted text.

Standard Syntax (HTML 2 Only; Deprecated)

 <listing> </listing> 

Attributes Defined by Internet Explorer

 accesskey="key" (5.5)      class="class name(s)" (4)      contenteditable=" false  true  inherit" (5.5)      dir="ltr  rtl" (5.5)      disabled="false  true" (5.5)      hidefocus="true  false" (5.5)      id="unique alphanumeric string" (4)      lang="language code" (4)      language="javascript  jscript  vbs  vbscript" (4)      style="style information" (4)      tabindex="number" (5.5)      title="advisory text" (4)      unselectable="on  off" (5.5) 

Events Defined by Internet Explorer

 onactivate, onbeforeactivate, onbeforecopy, onbeforecut, onbeforedeactivate,  onbeforeeditfocus, onbeforepaste, onblur, onclick, oncontextmenu, oncontrolselect,  oncopy, oncut, ondblclick, ondeactivate, ondrag, ondragend, ondragenter,  ondragleave, ondragover, ondragstart, ondrop, onfocus, onfocusin, onfocusout,  onhelp, onkeydown, onkeypress, onkeyup, onlosecapture, onmousedown, onmouseenter,  onmouseleave, onmousemove, onmouseout, onmouseover, onmouseup, onmousewheel,  onmove, onmoveend, onmovestart, onpaste, onpropertychange, onreadystatechange,  onresize, onresizeend, onresizestart, onselectstart, ontimeerror 

Example

  <listing>  This is a code listing. The preformatted text element &lt;PRE&gt; should be used instead of this deprecated element.  </listing>  

Compatibility

HTML 2

Internet Explorer 2, 3, 4, 5, 5.6, 6
Netscape 1, 2, 3, 4-4.7, 6, 7
Opera 6, 7

Notes

  • As a deprecated element, this element should not be used. This element is not supported by HTML 4, XHTML 1.0, or 1.1. It is still documented and supported by many browser vendors , however, and does creep into some pages. The pre element should be used instead of <listing> .

  • It appears that Internet Explorer browsers also make text within <listing> one size smaller than normal text, probably because the HTML 2 specification suggested that 132 characters fit to a typical line rather than 80.

<map> (Client-Side Image Map)

This element is used to implement client-side image maps. The element is used to define a
map that associates locations on an image with a destination URL. Each hot spot or hyperlink mapping is defined by an enclosed area element. A map is bound to a particular image through the use of the usemap attribute in the img element, which is set to the name of the map.

Syntax

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

Standard Event Attributes

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

Events Defined by Internet Explorer

 onbeforeactivate, onbeforecut, onbeforepaste, oncut, ondrag, ondragend,  ondragenter, ondragleave, ondragover, ondragstart, ondrop, onfocusin, onfocusout,  onhelp, onlosecapture, onmouseenter, onmouseleave, onmousewheel, onpaste,  onpropertychange, onreadystatechange, onscroll, onselectstart 

Element-Specific Attributes

name       Like id , this attribute is used to define a name associated with the element. In the case of the map element, the name attribute is the common way to define the name of the image map to be referenced by the usemap attribute within an <img> tag.

Example

  <map name="mainmap" id="mainmap">   <area shape="circle" coords="200,250,25"   href="file1.html" />   <area shape="rectangle" coords="50,50,100,100"   href="file2.html#important" />   <area shape="default" nohref="nohref" />   </map  > 

Compatibility

HTML 3.2, 4, 4.01
XHTML 1.0, 1.1

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

Notes

  • HTML 3.2 supports only the name attribute for the map element.

  • Client-side image maps are not supported under HTML 2. They were first suggested by Spyglass and later incorporated in Netscape and other browsers.

<marquee> (Marquee Display)

This proprietary element specifies a scrolling, sliding, or bouncing text marquee.

Proprietary Syntax (Defined by Internet Explorer)

 <marquee      accesskey="key" (5.5)      behavior="alternate  scroll  slide" (3)      bgcolor="color name  #RRGGBB" (3)      class="class name(s)" (4)      contenteditable=" false  true  inherit" (5.5)      datafld="column name" (4)      dataformatas="html  text" (4)      datasrc="data source id" (4)      direction="down  left  right  up" (3)      dir="ltr  rtl" (5.0)      disabled="false  true" (5.5)      height="pixels or percentage"      hidefocus="true  false" (5.5)      hspace="pixels" (3)      id="unique alphanumeric identifier" (4)      lang="language code" (4)      language="javascript  jscript  vbs  vbscript" (4)      loop="infinite  number" (3)      scrollamount="pixels" (3)      scrolldelay="milliseconds" (3)      style="style information" (4)      tabindex="number" (5.5)      title="advisory text" (4)      truespeed="false  true" (4)      unselectable="on  off" (5.5)      vspace="pixels" (3)      width="pixels or percentage" (3) >     </marquee> 

Events Defined by Internet Explorer

 onactivate, onafterupdate, onbeforeactivate, onbeforecut, onbeforedeactivate,  onbeforeeditfocus, onbeforepaste, onbeforeupdate, onblur, onbounce, onclick,  oncontextmenu, oncontrolselect, oncut, ondblclick, ondeactivate, ondrag, ondragend,  ondragenter, ondragleave, ondragover, ondragstart, ondrop, onerrorupdate,  onfilterchange, onfinish, onfocus, onfocusin, onfocusout, onhelp, onkeydown,  onkeypress, onkeyup, onlosecapture, onmousedown, onmouseenter, onmouseleave,  onmousemove, onmouseout, onmouseover, onmouseup, onmousewheel, onmove, onmoveend,  onmovestart, onpaste, onpropertychange, onreadystatechange, onresize, onresizeend,  onresizestart, onscroll,  onselectstart, onstart, ontimeerror, ondeactivate 

Element-Specific Attributes

behavior       This attribute controls the movement of marquee text across the marquee. The alternate option causes text to completely cross the marquee field in one direction and then cross in the opposite direction. A value of scroll for the attribute causes text to wrap around and start over again. This is the default value for a marquee. A value of slide for this attribute causes text to cross the marquee field and stop when its leading character reaches the opposite side.

bgcolor       This attribute specifies the marquee's background color. The value for the attribute can either be a color name or a color value defined in the hexadecimal #RRGGBB format.

datafld       This attribute is used to indicate the column name in the data source that is bound to the marquee element.

dataformatas       This attribute indicates whether the bound data is plain text ( text ) or HTML ( html ). The data bound with marquee is used to set the message that is scrolled.

datasrc       The value of this attribute is set to an identifier indicating the data source from which data is to be pulled. Bound data is used to set the message that is scrolled in the marquee .

direction       This attribute specifies the direction in which the marquee should scroll. The default is left . Other possible values for direction include down , right , and up .

height       This attribute specifies the height of the marquee in pixels or as a percentage of the window.

hspace       This attribute indicates the horizontal space in pixels between the marquee and surrounding content.

loop       This attribute indicates the number of times the marquee content should loop. By default, a marquee loops infinitely unless the behavior attribute is set to slide . It also is possible to use a value of infinite or - 1 to set the text to loop indefinitely.

scrollamount       This attribute specifies the width in pixels between successive displays of the scrolling text in the marquee.

scrolldelay       This attribute specifies the delay in milliseconds between successive displays of the text in the marquee.

truespeed       When this attribute is present, it indicates that the scrolldelay value should be honored for its exact value. If the attribute is not present, any values less than 60 are rounded up to 60 milliseconds.

vspace       This attribute indicates the vertical space in pixels between the marquee and surrounding content.

width       This attribute specifies the width of the marquee in pixels or as a percentage of the enclosing window.

Examples

  <marquee behavior="alternate">  SPECIAL VALUE !!! This week only !!!  </marquee>   <marquee id="marquee1" bgcolor="red" direction="right" height="30"   width="80%" hspace="10" vspace="10">  The super scroller scrolls again!! More fun than a barrel of  &lt;  BLINK  &gt;  elements.  </marquee>  

Compatibility

No Standards

Internet Explorer 3, 4, 5, 5.5, 6
Limited functionality in Netscape 6, 7

Notes

  • This is primarily a Microsoft-specific element, although a few other browsers, notably MSN TV and later Netscape and Mozilla versions, support it to some degree.

<menu> (Menu List)

This element is used to indicate a short list of items that can occur in a menu of choices.

Syntax (Transitional Only)

 <menu      class="class name(s)"      compact="compact"      dir="ltr  rtl"      id="unique alphanumeric string"      lang="language code"      style="style information"      title="advisory text"> </menu> 

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)      tabindex="number" (5.50      unselectable="on  off" (5.5) 

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, ontimeerror 

Element-Specific Attributes

compact       This attribute indicates that the list should be rendered in a compact style. Few browsers actually change the rendering of the list regardless of the presence of this attribute. The compact attribute requires no value under traditional HTML but should be set to a value of compact under XHTML transitional.

Example

 <h2>Taco List</h2>  <menu>   <li>  Fish  </li>   <li>  Pork  </li>   <li>  Beef  </li>   <li>  Chicken  </li>   </menu>  

Compatibility

HTML 2, 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

  • Under the strict HTML and XHTML specifications, this element is not defined. Because most browsers simply render this style of list as an unordered list, using the <ul> tag instead is preferable.

  • The HTML 2.0 and 3.2 specifications support only the compact attribute.

  • Most browsers tend not to support the compact attribute.

<meta> ( Meta-Information )

This element specifies general information about a document that can be used in document indexing. It also allows a document to simulate HTTP response headers which are useful for cache control, page ratings, page refresh time, and other useful things.

Standard Syntax

 <meta      content="string"      dir="ltr  rtl"      http-equiv="http header string"      id="unique alphanumeric string"      lang="language code"      name="name of meta-information"      scheme="scheme type" /> 

Events Defined by Internet Explorer

 onlayoutcomplete 

Element-Specific Attributes

content       This attribute contains the actual meta-information. The form of the meta-information varies greatly, depending on the value set for name .

http-equiv       This attribute binds the meta-information in the content attribute to an HTTP response header. If this attribute is present, the name attribute should not be used.

lang       This attribute is the language code associated with the language used in the content attribute.

name       This attribute associates a name with the meta-information contained in the content attribute. If present, the http-equiv attribute should not be used.

scheme       The scheme attribute is used to indicate the expected format of the value of the content attribute. The particular scheme also can be used in conjunction with the metadata profile, as indicated by the profile attribute for the head element.

Examples

 <!-- Use of the meta element to assist document indexing -->  <meta name="keywords" content="html, scripting"   scheme="Lycos" />  <!-- Use of the meta element to implement client-pull to automatically       load a page -->  <meta http-equiv="refresh"   content="3;URL='http://www.pint.com/'" />  <!-- Use of the META element to add rating information -->  <meta http-equiv="PICS-Label" content="(PICS-1.1   'http://www.rsac.org/ratingsv01.html'   1 gen true comment 'RSACi North America   Server' by 'webmaster@bigcompany.com'   for 'http://www.bigcompany.com' on   '1999.05.26T13:05-0500'   r (n 0 s 0 v 0 l 1))" />  

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.1, 2, 3, 4, 4.5-4.8, 6, 7
Opera 4-7

Notes

  • The meta element can occur only in the head element. It can be defined multiple times.

  • The meta element is an empty element (as defined in the HTML specifications) and does not have a closing tag nor contain any content. However, under XHTML 1.0, empty elements such as <meta> require a trailing slash: <meta /> .

  • A common use of the meta element is to set information for indexing tools, such as search engines. Common values for the name attribute when performing this function include author , description , and keywords; other attributes also might be possible.

  • The http-equiv attribute is often used to create a document that automatically loads another document after a set time. This is called client-pull . An example of a client-pull meta element is <meta http-equiv="refresh" content="10;URL='nextpage.html'" /> . Note that the content attribute contains two values. The first is the number of seconds to wait, and the second is the identifier URL and the URL to load after the specified time.

  • The http-equiv attribute is also used for page ratings, cache control, setting defaults such as language or scripting, and a variety of other tasks . In many cases, it would be better to set these values via the actual HTTP headers rather than via a <meta> tag.

  • The HTML 2.0 and 3.2 specifications define only the content , http-equiv , and name attributes.

<multicol> (Multiple Column Text)

This Netscape-specific element renders the enclosed content in multiple columns. This element should not be used; a table is a more standard way to render multiple columns of text across browsers.

Proprietary Syntax (Defined by Netscape)

 <multicol      class="class name(s)"      cols="number of columns"      gutter="pixels"      id="unique alphanumeric identifier"      style="style information"      width="pixels">     </multicol> 

Element-Specific Attributes

cols       This attribute indicates the number of columns in which to display the text. The browser attempts to fill the columns evenly.

gutter       This attribute indicates the width in pixels between the columns. The default value for this attribute is 10 pixels.

width       This attribute indicates the column width for all columns. The width of each column is set in pixels and is equivalent for all columns in the group . If the attribute is not specified, the width of columns will be determined by taking the available window size, subtracting the number of pixels for the gutter between the columns (as specified by the gutter attribute), and evenly dividing the result by the number of columns in the group (as set by the cols attribute).

Example

  <multicol cols="3" gutter="20">  Put a long piece of text here....  </multicol>  

Compatibility

No standards

Netscape 3, 4, 4.5-4.8

Notes

  • Page developers are strongly encouraged not to use this element. Netscape dropped this element for browser versions 6.0 and higher. Its inclusion in this book is for support of existing documents only.

<nobr> (No Breaks)

This proprietary element renders enclosed text without line breaks. Break points for where text may wrap can be inserted using the wbr element.

Common Syntax

 <nobr      class="class name(s)"      id="unique alphanumeric identifier"      style="style information"      title="advisory text">     </nobr> 

Attributes Defined by Internet Explorer

 contenteditable=" false  true  inherit " (5.5)      dir="ltr  rtl" (5.5)      disabled="false  true" (5.5)      unselectable="on  off" (5.5) 

Events Defined by Internet Explorer

 onbeforeactivate, onbeforecopy, onbeforecut, onbeforeedit, onbeforepaste, oncopy,  oncut, ondrag, ondragend, ondragenter, ondragleave, ondragover, ondragstart,  ondrop, onfocusin, onfocusout, onhelp, onlosecapture, onmouseenter, onmouseleave,  onmousewheel, onpaste, onpropertychange, onreadystatechange, onscroll,  onselectstart 

Examples

  <nobr>  This really long text ... will not be broken.  </nobr>   <nobr>  With this element it is often important to hint where a line may be broken using  &lt;  wbr  &gt;  .  <wbr>  This element acts as a soft return.  </nobr>  

Compatibility

No standards

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

Notes

  • While many browsers support this attribute, it is not part of any W3C standard.

<noembed> (No Embedded Media Support)

This Netscape-specific element is used to indicate alternative content to be displayed on browsers that cannot support an embedded media object. It should occur in conjunction with the embed element.

Proprietary Syntax (Defined by Netscape)

  <noembed>  Alternative content for non-embed supporting browsers  </noembed>  

Element-Specific Attributes

Netscape does not specifically define attributes for this element; however, Netscape documentation suggests that class , id , style , and title might be supported for this element.

Example

 <embed src="trailer.mov" height="150" width="150">    <noembed>       <img src="trailer.gif" alt="movie trailer" />       <br />    Sorry, this browser is not configured to display video.    </noembed> </embed> 

Compatibility

No standards

Netscape 2, 3, 4-4.7

Notes

  • This element will disappear as the <object> style of inserting media into a page becomes more common.

  • Even if other browsers do not support the tag and render its contents, it works in the manner it was designed.

<noframes> (No Frame Support Content)

This element is used to indicate alternative content to be displayed on browsers that do not support frames .

Standard Syntax

 <noframes      class="class name(s)"      dir="ltr  rtl"      id="unique alphanumeric identifier"      lang="language code"      style="style information"      title="advisory text">  Alternative content for non-frame-supporting browsers  </noframes> 

Events Defined by Internet Explorer

 onreadystatechange 

Example

  <frameset rows="100,*">   <frame src="controls.html"> name-"frame1" id="frame1"   <frame src="content.html"> "name=frame2" id="frame2"   <noframes>  Sorry, this browser does not support frames.  </noframes>   </frameset>  

Compatibility

HTML 4, 4.01 (transitional and frameset)
XHTML 1.0 (transitional and frameset)

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

Notes

  • This element should be used within the scope of the frameset element.

  • The benefit of events and sophisticated attributes, such as style , is unclear for browsers that would use content within <noframes >, given that older browsers that don't support frames probably would not support these features.

<noscript> (No Script Support Content)

This element is used to enclose content that should be rendered on browsers that do not support scripting or that have scripting turned off.

Syntax

 <noscript      class="class name(s)"      dir="ltr  rtl"      id="unique alphanumeric identifier"      lang="language code"      style="style information"      title="advisory text">  Alternative content for non-script-supporting browsers  </noscript> 

Events Defined by Internet Explorer

 onreadystatechange 

Example

  <script language="type/javascript">  <!--  window.location="http://www.pint.com";  // -->  </script>   <noscript>  JavaScript is not supported. Follow this  <a href="http://www.pint.com">  link  </a>  instead.  </noscript>  

Compatibility

HTML 4, 4.01
XHTML 1.0, 1.1

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

Notes

  • Improved functionality for the noscript element might come if it is extended to deal with the lack of support for one scripting language or another. Currently, the element is used only to indicate whether any scripting is supported or not.

  • Oddly <noscript> is not allowed in the head even though <script> is.

<object> (Embedded Object)

This element specifies an arbitrary object to be included in an HTML document. Initially, this element was used to insert ActiveX controls, but according to the specification, an object can be any media object, document, applet, ActiveX control, or even image.

Standard Syntax

 <object      align="bottom  left  middle  right  top" (transitional only)      archive="url"      border="percentage  pixels" (transitional only)      class="class name(s)"      classid="id"      codebase="URL"      codetype="MIME Type"      data="URL of data"      declare="declare"      dir="ltr  rtl"      height="percentage  pixels"      hspace="percentage  pixels" (transitional only)      id="unique alphanumeric identifier"      lang="language code"      name="unique alphanumeric name"      standby="standby text string"      style="style information"      tabindex="number"      title="advisory text"      type="MIME Type"      usemap="URL"      vspace="percentage  pixels" (transitional only)      width="percentage  pixels">  param elements and alternative rendering  </object> 

Attributes Defined by Internet Explorer

 accesskey="character" (4)      align="absbottom  absmiddle  baseline  texttop" (4)      code="url" (4)      datafld="column name" (4)      datasrc="id for bound data" (4)      hidefocus="true  false" (5.5)      language="javascript  jscript  vbs  vbscript" (4)      unselectable="on  off" (5.5) 

Standard Event Attributes

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

Events Defined by Internet Explorer

 onactivate, onbeforedeactivate, onbeforeeditfocus, onblur, oncellchange,  oncontrolselect, ondataavailable, ondatasetchanged, ondatasetcomplete,  ondeactivate, ondrag, ondragend, ondragenter, ondragleave, ondragover, ondragstart,  ondrop,  onerror, onfocus, onlosecapture, onmove, onmoveend, onmovestart, onpropertychange,  onreadystatechange, onresize, onresizeend, onresizestart, onrowenter, onrowexit,  onrowsdelete, onrowsinserted, onscroll, onselectstart 

Element-Specific Attributes

align       This attribute aligns the object with respect to the surrounding text. The default is left . The HTML specification defines bottom , middle , right , and top , as well. Browsers might provide an even richer set of alignment values. The behavior of alignment for objects is similar to images. Under the strict HTML and XHTML specifications, the object element does not support this attribute.

archive       This attribute contains a URL for the location of an archive file. An archive file typically is used to contain multiple object files to improve the efficiency of access.

border       This attribute specifies the width of the object's borders in pixels or as a percentage.

classid       This attribute contains a URL for an object's implementation. The URL syntax depends upon the object's type. With ActiveX controls, the value of this attribute does not appear to be a URL but something of the form CLSID : object-id; for example, CLSID: 99B42120-6EC7-11CF-A6C7- 00AA00A47DD2.

code       Under the old Microsoft implementation, this attribute contains the URL referencing a Java applet class file. The way to access a Java applet under the HTML/XHTML specification is to use <object classid="java : classname.class"> . The pseudo-URL java: is used to indicate a Java applet. Microsoft Internet Explorer 4 and beyond support this style, so code should not be used.

codebase       This attribute contains a URL to use as a relative base to access the object specified by the classid attribute.

codetype       This attribute specifies an object's MIME type. Do not confuse this attribute with type , which specifies the MIME type of the data the object may use, as defined by the data attribute.

data       This attribute contains a URL for data required by an object.

datafld       This Microsoft-specific attribute is used to indicate the column name in the data source that is bound to the object element.

datasrc       The value of this Microsoft-specific attribute is set to an identifier indicating the data source to pull data from.

declare       This attribute declares an object without instantiating it. This is useful when the object will be a parameter to another object. In traditional HTML, this attribute takes no value; under XHTML, set it equal to declare .

height       This attribute specifies the height of the object in pixels or as a percentage of the enclosing window.

hspace       This attribute indicates the horizontal space, in pixels or percentages, between the object and surrounding content.

name       Under the Microsoft definition, this attribute defines the name of the control so scripting can access it. Older HTML specifications suggest that it is a name for form submission, but this meaning is unclear and not supported by browsers.

standby       This attribute contains a text message to be displayed while the object is loading.

tabindex       This attribute takes a numeric value indicating the position of the object in the tabbing index for the document. Tabbing proceeds from the lowest positive tabindex value to the highest. Negative values for tabindex will leave the object out of the tabbing order. When tabbing is not explicitly set, the browser can tab through items in the order they are encountered .

type       This attribute specifies the MIME type for the object's data. This is different from the codetype , which is the MIME type of the object and not of the data it uses.

usemap       This attribute contains the URL of the image map to be used with the object. Typically, the URL will be a fragment identifier referencing a map element somewhere else within the file. The presence of this attribute indicates that the type of object being included is an image.

vspace       This attribute indicates the vertical space, in pixels or percentages, between the object and surrounding text.

width       This attribute specifies the width of the object in pixels or as a percentage of the enclosing window or block element.

Examples

  <object id="IeLabel1" width="325" height="65"   classid="CLSID:99B42120-6EC7-11CF-A6C7-00AA00A47DD2">   <param name="_ExtentX" value="6879" />   <param name ="_ExtentY" value="1376" />   <param name="Caption" value="Hello World" />   <param name="Alignment" value="4" />   <param name="Mode" value="1" />   <param name="ForeColor" value="#FF0000" />   <param name="FontName" value="Arial" />   <param name="FontSize" value="36" />   <b>  Hello World for non-ActiveX users!  </b>   </object>   <object classid="java:Blink.class"   standby="Here it comes"   height="100" width="300">   <param name="lbl" value="Java is fun, exciting, and new." />   <param name="speed" value="2" />  This will display in non-Java-aware or -enabled browsers.  </object>   <object data="pullinthisfile.html">  Data not included!  </object>  

Compatibility

HTML 4, 4.01
XHTML 1.0, 1.1, Basic

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

Notes

  • Under the strict HTML and XHTML specifications, the object element loses most of
    its presentation attributes, including align , border , height , hspace , vspace , and width . These attributes are replaced by style sheet rules.

  • The HTML 4.01 specification reserves the datafld , dataformatas , and datasrc attributes for future use. However, these attributes were dropped in XHTML, though they are well supported by Internet Explorer 4 and beyond.

  • Alternative content should be defined within an <object> tag after any enclosed <param> tags.

  • The object element is still mainly used to include multimedia binaries in pages. Although the specification defines that it can load in HTML files and create image maps, not every browser supports this, and few developers are aware of these features. In theory, this very versatile tag should take over duties from the venerable <img> tag in future XHTML specifications.

  • See Chapter 15 for specific examples of object and an expanded discussion.

<ol> (Ordered List)

This element is used to define an ordered or numbered list of items. The numbering style comes in many forms, including letters, Roman numerals, and regular numerals. The individual items within the list are specified by li elements included with the ol element.

Standard Syntax

 <ol      class="class name(s)"      compact="compact" (transitional only)      dir="ltr  rtl"      id="unique alphanumeric identifier"      lang="language code"      start="number" (transitional only)      style="style information"      title="advisory text"      type="a  A  i  I  1"> (type attribute transitional only)  li elements only  </ol> 

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 Event Attributes

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

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, onlayoutcomplete,  onlosecapture, onmouseenter, onmouseleave, onmousewheel, onmove, onmoveend,  onmovestart, onpaste, onpropertychange, onreadystatechange, onresize, onresizeend,  onresizestart, onselectstart, ontimeerror 

Element-Specific Attributes

compact       This attribute indicates that the list should be rendered in a compact style. Few browsers actually change the rendering of the list regardless of the presence of this attribute. The compact attribute requires no value under traditional HTML, but under XHTML should be set to compact .

start       This attribute specifies the start value for numbering the individual list items. Although the ordering type of list elements might be Roman numerals, such as XXXI, or letters, the value of start is always represented as a number. To start numbering elements from the letter "C," use <ol type="A" start="3"> .

type       This attribute indicates the numbering type: a indicates lowercase letters, A indicates uppercase letters, i indicates lowercase Roman numerals, I indicates uppercase Roman numerals, and 1 indicates numbers. Type set in an ol element is used for the entire list unless a type attribute is used within an enclosed li element.

Examples

  <ol type="1">   <li>  First step  </li>   <li>  Second step  </li>   <li>  Third step  </li>   </ol>   <ol compact="compact" type="I" start="30">   <li>Clause 30</li>   <li>Clause 31</li>   <li>Clause 32</li>   </ol>  

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

  • Under the strict HTML and XHTML specifications, the ol element no longer supports the compact , start , and type attributes. These aspects of lists can be controlled with style sheet rules.

  • Under the XHTML 1.0 specification, the compact attribute no longer can be minimized, but must have a quoted attribute value: <ol compact="compact"> .

  • The HTML 3.2 specification supports only the compact , start , and type attributes.

  • The HTML 2.0 specification supports only the compact attribute.

<optgroup> (Option Grouping)

This element specifies a grouping of items in a selection list defined by option elements so that the menu choices can be presented in a hierarchical menu or similar alternative fashion to improve access through nonvisual browsers.

Standard Syntax

 <optgroup      class="class name(s)"      dir="ltr  rtl"      disabled="disabled"       id="unique alphanumeric identifier"      label="text description"      lang="language code"      style="style information"      title="advisory text">  option elements  </optgroup> 

Standard Event Attributes

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

Element-Specific Attributes

disabled       Occurrence of this attribute indicates that the enclosed set of options is disabled.

label       This attribute contains a short label that might be more appealing to use when the selection list is rendered as items in a hierarchy.

Example

 Where would you like to go for your vacation?  <select name="vacation" id="vacation">   <option id="ch1" value="Hong Kong">Hong Kong</option>   <optgroup label="South Pacific">   <option id="ch2" label="Australia" value="Australia">  Australia  </option>   <option id="ch3" label="Fiji" value="Fiji">   Wakaya (Fiji Islands)</option>   <option id="ch4" value="New Zealand">  New Zealand  </option>   </optgroup>   <option id="ch5" value="home" selected="selected">  Your backyard  </option>   </select>  

Compatibility

HTML 4, 4.01
XHTML 1.0, 1.1

Internet Explorer 6
Netscape 6, 7
Opera 7

Notes

  • This element should occur only within the context of a select element.

  • Only the most modern browsers present this element in a visually meaningful fashion.

<option> (Option in Selection List)

This element specifies an item in a selection list defined by the select element.

Standard Syntax

 <option      class="class name(s)"      dir="ltr  rtl"      disabled="disabled"      id="unique alphanumeric identifier"      label="text description"      lang="language code"      selected="selected"      style="style information"      title="advisory text"      value="option value">     </option> 

Attributes Defined by Internet Explorer

 language="javascript  jscript  vbs  vbscript" (4) 

Standard Event Attributes

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

Events Defined by Internet Explorer

 onlayoutcomplete, onlosecapture, onpropertychange, onreadystatechange,  onselectstart, ontimeerror 

Element-Specific Attributes

disabled       Presence of this attribute indicates that the particular item is not selectable. Traditional HTML did not require a value for this attribute, but it should be set to disabled under XHTML.

label       This attribute contains a short label that might be more appealing to use when the selection list is rendered as a hierarchy due to the presence of an optgroup element.

selected       This attribute indicates that the associated item is the default selection. If not included, the first item in the selection list is the default. If the select element enclosing the option elements has the multiple attribute, the selected attribute might occur in multiple entries. Otherwise , it should occur in only one entry. Under XHTML, the value of the selected attribute must be set to selected .

value       This attribute indicates the value to be included with the form result when the item is selected.

Example

 Which is your favorite dog?:  <select>   <option value="Scotty">  Angus  </option>   <option value="Golden Retriever">  Borrego  </option>   <option value="Choco Lab">  Dutch  </option>   <option value="Mini Schnauzer" selected="selected">  Tucker  </option>   </select>  

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

  • Under HTML specifications, the closing tag for <option> is optional. However, for XHTML compatibility the closing tag </option> is required.

  • This element should occur only within the context of a select element.

  • The HTML 2.0 and 3.2 specifications define only the selected and value attributes for this element.

<p> (Paragraph)

This element is used to define a paragraph of text.

Standard Syntax

 <p      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">     </p> 

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 Event Attributes

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

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, onlayoutcomplete,  onlosecapture, onmouseenter, onmouseleave, onmousewheel, onmove, onmoveend,  onmovestart, onpaste, onpropertychange, onreadystatechange, onresize, onresizeend,  onresizestart, onselectstart, ontimeerror 

Element-Specific Attributes

align       This attribute specifies the alignment of text within a paragraph. The default value is left . The transitional specification of HTML 4.01 also defines center , justify , and right . However, under the strict HTML and XHTML specifications, text alignment can be handled through a style sheet rule.

Examples

  <p align="right">  A right-aligned paragraph  </p>   <p id="para1" class="defaultParagraph"   title="Introduction Paragraph">  This is the introductory paragraph for a very long paper about nothing.  </p>  

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

  • Because p is a block element browsers typically insert a blank line, but this rendering should not be assumed, given the rise of style sheets.

  • Under the strict HTML and XHTML specifications, the align attribute is not supported. Alignment of text can instead be accomplished using style sheets.

  • The closing tag for the <p> tag is optional under the HTML specification; however, under the XHTML 1.0 specification, the closing tag </p> is required for XHTML compatibility.

  • As a logical element, empty paragraphs are ignored by browsers, so do not try to use multiple <p> tags in a row, like <p><p><p><p> , to add blank lines to a Web page. This will not work; use the <br> tag instead.

  • Remove the empty paragraph <p>&nbsp;</p> markup inserted by WYSIWYG editors.

  • The HTML 3.2 specification supports only the align attribute with values of center , left , and right .

  • The HTML 2.0 specification supports no attributes for the p element.

<param> (Object Parameter)

This element specifies a parameter to be passed to an embedded object that is specified with the object or applet elements. This element should occur only within the scope of one of these elements.

Standard Syntax

 <param      id="unique alphanumeric identifier"      name="parameter name"      type="mime Type"      value="parameter value"      valuetype="data  object  ref" /> 

Attributes Defined by Internet Explorer

 datafld="column name" (4)      dataformatas="html  text" (4)      datasrc="data source id" (4) 

Element-Specific Attributes

datafld       This Internet Explorer-specific attribute is used to indicate the column name in the data source that is bound to the <param> tag's value.

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

datasrc       The value of this attribute is set to an identifier indicating the data source to pull data from. Bound data is used to set the value of the parameters passed to the object or applet with which this <param> tag is associated.

name       This attribute contains the parameter's name. The name of the parameter depends on the particular object being inserted into the page, and it is assumed that the object knows how to handle the passed data. Do not confuse the name attribute for this element with the name attribute used for form elements. In the latter case, the name attribute does not have a similar meaning to id , but rather specifies the name of the data to be passed to an enclosing <object> tag.

type       When the valuetype attribute is set to ref , the type attribute can be used to indicate the type of the information to be retrieved. Legal values for this attribute are in the form of MIME types, such as text/html .

value       This attribute contains the parameter's value. The actual content of this attribute depends on the object and the particular parameter being passed in, as determined by the name attribute.

valuetype       This attribute specifies the type of the value attribute being passed in. Possible values for this attribute include data , object , and ref . A value of data specifies that the information passed in through the value parameter should be treated just as data. A value of ref indicates that the information being passed in is a URL that indicates where the data to be used is located. The information is not retrieved, but the URL is passed to the object, which then can retrieve the information if necessary. The last value of object indicates that the value being passed in is the name of an object as set by its id attribute. In practice, the data attribute is used by default.

Examples

  <applet code="plot.class">   <param name="min" value="5" />   <param name="max" value="30" />   <param name="ticks" value=".5" />   <param name="line-style" value="dotted" />   </applet>   <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"   codebase="swflash.cab#version=2,0,0,0"   height="100" width="100">   <param id="param1" name="Movie" value="SplashLogo.swf" />   <param id="param2" name="Play" value="True" />   </object>  

Compatibility

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

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

Notes

  • The HTML 3.2 specification supports only the name and value attributes for this element.

  • Under XHTML 1.0, empty elements such as <param> require a trailing forward slash: <param /> .

<plaintext> (Plain Text)

This deprecated element from the HTML 2.0 specification renders the enclosed text as plain text and forces the browser to ignore any enclosed HTML. Typically, information affected by the <plaintext> tag is rendered in monospaced font. This element is no longer part of the HTML standard and should never be used.

Syntax (HTML 2; Deprecated Under HTML 4)

 <plaintext> 

Attributes Defined by Internet Explorer

 accesskey="key" (5.5)      class="class name(s)" (4)      contenteditable="false  true  inherit" (5.5)      disabled="false  true" (5.5)      dir="ltr  rtl" (4)      hidefocus="true  false" (5.5)      id="unique alphanumeric identifier" (4)      lang="language code" (4)      language="javascript  jscript  vbs  vbscript" (4)      style="style information" (4)      tabindex="number" (5.5)      title="advisory text" (4) 

Example

  <!DOCTYPE html PUBLIC "-//IETF//DTD HTML 2.0//EN">   <html>   <head><title>  Plaintext Example  </title></head>   <body>  The rest of this file is in plain text.  <plaintext>  Even though this is supposed to be  <b>  bold  </b>,  the tags still show.    There is no way to turn plain text off once it is on.  </plaintext>  does nothing to help. Even  </body>  and  </html>  will show up. 

Compatibility

HTML 2

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

Notes

  • No closing tag for this element is necessary because the browser will ignore all tags after the starting tag.

  • This element should not be used. Plain text information can be indicated by a file type, and information can be inserted in a preformatted fashion using the pre element.

  • Most browsers continue to support this tag despite documentation to the contrary.

<pre> (Preformatted Text)

This element is used to indicate that the enclosed text is preformatted, meaning that spaces, returns, tabs, and other formatting characters are preserved. Browsers will, however, acknowledge most HTML elements that are found within a < pre> tag. Preformatted text generally will be rendered by the browsers in a monospaced font.

Standard Syntax

 <pre      class="class name(s)"      dir="ltr  rtl"      id="unique alphanumeric value"      lang="language code"      style="style information"      title="advisory text"      width="number"   (transitional only)      xml:space="preserve">     </pre> 

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)      wrap="soft  hard  off" (4) 

Standard Event Attributes

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

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, ontimeerror 

Element-Specific Attributes

width       This attribute should be set to the width of the preformatted region. The value of the attribute should be the number of characters to display. In practice, this attribute is not supported and is dropped under the strict HTML 4.01 specification.

wrap       In some versions of Microsoft browsers, this attribute controls word wrap behavior within a <pre> tag. The default value of off for the attribute forces the element not to wrap text, so the author must manually enter line breaks. Values of hard or soft cause word wrap and set different types of line breaks in the wrapped text. Given the nature of the pre element, the value of this attribute is limited.

xml:space       This attribute is included from XHTML 1.0 and is used to set whether spaces need to be preserved within the element or whether the default white space handling should be employed. It is curious that an element defined to override traditional white space rules would allow such an attribute, and in practice this attribute is not used by developers.

Example

  <pre>  Within PREFORMATTED text      A L L    formatting IS   PRESERVED    NO  m    a    t    t   e   r how wild it is. Remember that some  <b>  HTML  </b>  markup is allowed within the &lt;PRE&gt; element.  </pre>  

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

  • The HTML 4.01 and XHTML 1.0 transitional specifications state that the applet , basefont , big , font , img , object , small , sub , and sup elements should not be used within the <pre> tag. The strict HTML and XHTML specifications state that only the <big> , <img> , <object> , <small> , <sub> , and <sup> tags should not be used within the <pre> tag. The other excluded elements are missing, as they are deprecated from the strict specification. Although these elements should not be used, it appears that the two most popular browsers will render them anyway.

  • The strict HTML and XHTML specifications drop support for the width attribute, which was not well-supported anyway.

  • The HTML 2.0 and 3.2 specifications support only the width attribute for <pre> .

<q> (Quote)

This element indicates that the enclosed text is a short inline quotation.

Standard Syntax

 <q      cite="url of source"      class="class name(s)"      dir="ltr  rtl"      id="unique alphanumeric string"      lang="language code"      style="style information"      title="advisory text">     </q> 

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) 

Standard Event Attributes

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

Events Defined by Internet Explorer

 onactivate, onbeforedeactivate, onbeforeeditfocus, onblur, oncontrolselect,  ondeactivate, ondrag, ondragend, ondragenter, ondragleave, ondragover, ondragstart,  ondrop, onfocus, onmouseenter, onmouseleave, onmove, onmoveend, onmovestart,  onreadystatechange, onresizeend, onresizestart, onselectstart, ontimeerror 

Element-Specific Attributes

cite       The value of this attribute is a URL that designates a source document or message for the information quoted. This attribute is intended to point to information explaining the context or the reference for the quote.

Example

  <q style="color: green;">  A few green balls and a rainbow bar will give you an exciting Web page Christmas Tree!  </q>  

Compatibility

HTML 4, 4.01
XHTML 1.0, 1.1, Basic

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

Notes

  • This element is intended for short quotations that don't require paragraph breaks, as compared to text that would be contained within <blockquote> .

  • Some browsers, like Internet Explorer, may not make any sort of style change for quotations, but it is possible to apply a style rule.

  • Most modern standards-aware browsers, like Mozilla, Opera, and Safari, should add quotes around text enclosed within the q element.

rt (Ruby Text)

This initially Microsoft-specific proprietary element is used within a < ruby> tag to create ruby text , or annotations or pronunciation guides for words and phrases. The base text should be enclosed in a < ruby> tag; the annotation, enclosed in an < rt> tag , will appear as smaller text above the base text. A variation on this element is defined by XHTML 1.1.

Syntax (Defined by Microsoft)

 <rt      accesskey="key" (5)      class="class name(s)" (5)      contenteditable="false  true  inherit" (5.5)      dir="ltr  rtl" (5)      disabled="false  true" (5.5)      hidefocus="true  false" (5.5)      id="unique alphanumeric identifier" (5)      lang="language code" (5)      language="javascript  jscript  vbs  vbscript  xml" (5)      name="string" (5)      style="style information" (5)      tabindex="number" (5)      title="advisory text" (5)      unselectable="on  off"> (5)  ... ruby text ..  </rt> 

Events Defined by Internet Explorer

 onactivate, onafterupdate, onbeforeactivate, onbeforecut, onbeforepaste, oncut,  ondrag, ondragend, ondragenter, ondragleave, ondragover, ondragstart, ondrop,  onfocusin, onfocusout, onhelp, onlosecapture, onmouseenter, onmouseleave,  onmousewheel, onpaste, onpropertychange, onreadystatechange, onscroll,  onselectstart 

Example

  <ruby>  Base Text  <rt>  Ruby Text  </rt>   </ruby>  

Compatibility

XHTML 1.1

Internet Explorer 5, 5.5, 6

Notes

  • This element works only in Internet Explorer 5.0 and higher.

  • The rt element must be used within the ruby element.

  • Microsoft defines rt as an inline element that requires no closing tag; however, under the Ruby XHTML specification, it does have a close tag, so it should be used in support of the future standard being widely adopted.

  • At the time of this edition's writing in 2003, this element should be used only in an Internet Explorer - exclusive environment because other browsers will not interpret it or the ruby element yet, despite the rise of the Ruby module for XHTML 1.1.

ruby

This Microsoft-specific proprietary element is used with the rt element to create annotations or pronunciation guides for words and phrases. The base text should be enclosed in a <ruby> tag; the annotation, enclosed in a < rt> tag, will appear as smaller text above the base text.

Syntax Defined by Microsoft

 <ruby      accesskey="key" (5)      class="class name(s)" (5)      contenteditable="false  true  inherit" (5.5)      dir="ltr  rtl" (5)      disabled="false  true" (5.5)      hidefocus="true  false" (5.5)      id="unique alphanumeric identifier" (5)      lang="language code" (5)      language="javascript  jscript  vbs  vbscript  xml" (5)      name="string" (5)      style="style information" (5)      tabindex="number" (5)      title="advisory text"> (5)  ... base text ...   <rt>ruby text</rt>  </ruby> 

Events Defined by Internet Explorer

 onactivate, onafterupdate, onbeforeactivate, onbeforecut, onbeforepaste, oncut,  ondrag, ondragend, ondragenter, ondragleave, ondragover, ondragstart, ondrop,  onfocusin, onfocusout, onhelp, onlosecapture, onmouseenter, onmouseleave,  onmousewheel, onpaste, onpropertychange, onreadystatechange, onscroll,  onselectstart 

Element-Specific Attributes

name       Sets a name for the ruby base text.

Example

  <ruby>  This is the base text within the ruby element  <rt>  This is the ruby text, which should appear in a smaller font     above the base text in Internet Explorer 5.0 or higher.  </rt>   </ruby>   <ruby>  Base Text  <rt>  Ruby Text  </rt>   </ruby>  
click to expand

Compatibility

XHTML 1.1

Internet Explorer 5, 5.5, 6

Notes

  • This element works only in Internet Explorer 5.0 and higher.

  • The ruby element must be used in conjunction with the rt element; otherwise, it will have no meaning.

  • At the time of this edition's writing in 2003, this element should be used only in an Internet Explorer - exclusive environment because other browsers will not interpret it or the rt element yet, despite the rise of the Ruby module for XHTML 1.1.



 <  Day Day Up  >  


HTML & XHTML
HTML & XHTML: The Complete Reference (Osborne Complete Reference Series)
ISBN: 007222942X
EAN: 2147483647
Year: 2003
Pages: 252
Authors: Thomas Powell

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