The cover of The Complete Idiot's Guide to Create a Web Page The Complete Idiot's HTML Tag Reference

| Index | Previous Tag: <KBD> | Next Tag: <LAYER> |


<LABEL>

Creates a descriptive label that's associated with a form control.

Support:

HTML StandardInternet ExplorerNetscape Navigator
4.0 and later 4.0 and later Not supported
Notes:
  • This tag requires the </LABEL> end tag.
Attributes:
ACCESSKEY = "Text (single character)"
A character to use as a keyboard shortcut for selecting the control.

Support:

HTML StandardInternet ExplorerNetscape Navigator
4.0 and later 4.0 and later Not supported

Notes:

  • The access key is invoked by using it as a key combination. For example, if you specify ACCESSKEY="P", then the user invokes the key by pressing Alt+P (Windows) or Cmd+P (Mac).

CLASS = "Text"
The style sheet class used by the tag.

Support:

HTML StandardInternet ExplorerNetscape Navigator
4.0 and later 4.0 and later Not supported

Notes:

  • You can specify two or more classes; be sure to separate each class name with a space.

FOR = "Text"
The form control that the label is associated with.

Support:

HTML StandardInternet ExplorerNetscape Navigator
4.0 and later 4.0 and later Not supported

Notes:

  • To use this attribute, you must add an ID attribute to the associated form control, and then set FOR equal to that ID value (see the example).

ID = "Text"
An alphanumeric string that uniquely identifies the tag.

Support:

HTML StandardInternet ExplorerNetscape Navigator
4.0 and later 4.0 and later Not supported

Notes:

  • Although you can use letters and numbers for the ID, the first character must be a letter.

LANG = "Text"
The language used by the tag's attribute values and text content.

Support:

HTML StandardInternet ExplorerNetscape Navigator
4.0 and later 4.0 and later Not supported

STYLE = "Text"
The style or styles to use with the tag.

Support:

HTML StandardInternet ExplorerNetscape Navigator
4.0 and later 4.0 and later Not supported

Notes:

  • If you enter multiple style properties, separate each one with a semi-colon (;).

Example:
<FORM>
<LABEL ACCESSKEY="N" FOR="FirstName">First <U>N</U>ame:</LABEL> 
<INPUT TYPE=TEXT ID="FirstName">
<BR>
<LABEL ACCESSKEY="L" FOR="LastName"><U>L</U>ast Name:</LABEL> 
<INPUT TYPE=TEXT ID="LastName">
</FORM>
How It Looks:


| Index | Previous Tag: <KBD> | Next Tag: <LAYER> |