See also: HTML tags
Note to readers: This document attempts to define all HTML attributes - not just those available for use on E2.
Please do not confuse this document with E2 HTML tags, E2 HTML, E2 HTML tags : Quick Start, or E2 FAQ: HTML.
I know this is a very long writeup, but it's a lot of information. I honestly don't expect anyone to read the whole thing, but feel free to use it as a reference. I have grouped the text into three separate sections, so in case you just want to skip to a section, look for the big headings. The sections are:
- Attribute Categories
- Default Values
- Attribute Names
Attribute Categories
Just as HTML tags can be broken down into categories, the HTML attributes used in these tags can also be categorized. Attribute categories define the types of values that can be assigned to different attributes. All categories below specify related attributes in this group, and when applicable I have added "Valid Values" or "Common Values". "Valid Values" specify the only acceptalbe values for a group. While "Common Values" only specify values that are most often seen - other values may be acceptable.
- Alignments
Alignments specify how to align one element or object with respect to another element or object
- CAlign
Caption alignment - specifies how/where to align a table caption
Valid Values: top, bottom, left, right
Related Attributes: align
- IAlign
Image alignment - specifies how/where to align an img
Common Values: top, middle, bottom, left, right
Related Attributes: align
- LAlign
Legend alignment - specifies how/where to align a Fieldset legend
Valid Values: top, bottom, left, right
Related Attributes: align
- TAlign
Table alignment - specifies how/where to align a table
Valid Values: left, center, right
Related Attributes: caption
- CDATA
CDATA can include any character defined by the document's character set, and may also include character entities
Related Attributes: alt, archive, axis, class, code, content, face, language, name, object, scheme, size, value, version
- Character
A character as defined by ISO 10646 (i.e., a Unicode character)
Related Attributes: accesskey, char
- Charset
A character set as defined by RFC 2045. A common character set for web use is UTF-8.
Related Attributes: charset
- Charsets
A space separated list of character sets (see Charset above)
Related Attributes: accept-charset
- Color
An sRGB color value or a valid named color value
Related Attributes: bgcolor, color, link, text, vlink
- ContentType
A valid content type/media type/MIME type as defined by RFC 2045
Related Attributes: caption
- ContentTypes
A comma separated list of content types (see ContentType above)
Related Attributes: accept
- Coords
A comma separated list of coordinates or lengths (see Length below). Usually used for cartesian coordinates
Related Attributes: coords
- DateTime
a date and time information in ISO date format
Related Attributes: datetime
- FrameTarget
Specifies which frame or window to render the content in
Common Values: _self, _top, _blank, _parent
Related Attributes: target
- ID
Defines a unique token that must begin with a letter ([A-Za-z]) and may be followed by any number of letters, digits ([0-9]), hyphens ("-"), underscores ("_"), colons (":"), and periods ("."). Unlike Names (see below) IDs should not be repeated.
Related Attributes: id
- IDREF
Specifies a reference to an ID token used elsewhere
Related Attributes: headers
- IDREFs
Specifies a space separated list of tokens
Related Attributes: caption
- InputType
- Specifies the type of input element for use in a form
Valid Values: text, password, checkbox, radio, submit, reset, file, hidden, image, button
Related Attributes: type
- LanguageCode
Specifies a language code as defined by RFC 1766
Common Values: en, fr, de, da, el, it
Related Attributes: hreflang, lang
- Length
Specifies a size in pixels or in percentage. It should be noted that percentage values larger than 100% are allowable, but are typically not user friendly.
Related Attributes: cellpadding, cellspacing, charoff, height, width
- LinkTypes
A space separated list of link types
Common Values: Alternate, Stylesheet, Start, Next, Prev, Contents, Index, Glossary, Copyright, Chapter, Section, Subsection, Appendix, Help, Bookmark
Related Attributes: rel, rev
- List Styles
- LIStyle
Specifies the style of the list item
Valid Values: (See OLStyle and ULStyle below)
Related Attributes: type
- OLStyle
Specifies the style of the ordered list
Valid Values: 1, a, A, i, I
Related Attributes: type
- ULStyle
Specifies the style of the unordered list
Valid Values: disc, square, circle
Related Attributes: type
- MediaDesc
single or comma-separated list of media descriptors
Common Values: screen, tty, tv, projection, handheld, print, print, braille, aural, all
Related Attributes: media
- MultiLength
Defines a pixel, percentage, or relative length (see Length above) for an element
Related Attributes: width
- MultiLengths
Defines a comma separated list of pixel, percentage, or relative lengths (see Length above) for a group of elements
Related Attributes: width
- Name
Defines a token that must begin with a letter (A-Za-z) and may be followed by any number of letters, digits (0-9), hyphens ("-"), underscores ("_"), colons (":"), and periods ("."). Unlike IDs (see above) Names can be repeated.
Related Attributes: http-equiv, name
- Number
Number attributes must contain one or more digits
Related Attributes: cols, colspan, maxlength, rows, rowspan, size, span, start, tabindex, value, width
- Pixels
An integer representing length in pixels
Related Attributes: border, hspace, marginheight, marginwidth, size, vspace
- Scope
Specifies the scope covered by a table header
Valid Values: row, col, rowgroup, colgroup
Related Attributes: border, hspace, marginheight, marginwidth, size, vspace
- Script
script expression (usually JavaScript) typically dealing with document or page events
Related Attributes: onblur, onchange, onclick, ondblclick, onfocus, onkeydown, onkeypress, onkeyup, onload, onmousedown, onmousemove, onmouseout, onmouseover, onmouseup, onreset, onselect, onsubmit, onunload
- Shape
Defines a shape. Typically used in image maps.
Valid Values: rect, circle, poly, default
Related Attributes: shape
- StyleSheet
Defines inline style sheet data
Related Attributes: style
- Text
Text differs from CDATA only in that text attributes are meant to be displayed to the user (though sometimes only as alternative content)
Related Attributes: abbr, alt, label, prompt, standby, summary, title
- TFrame
Defines how the frame around a table is rendered
Valid Values: void, above, below, hsides, lhs, rhs, vsides, box, border
Related Attributes: frame
- TRules
Defines table rulings between rows and columns
Valid Values: none, groups, rows, cols, all
Related Attributes: caption
- URI
Defines a Uniform Resource Identifier (most often a URL)
Related Attributes: action, background, cite, classid, codebase, data, href, longdesc, profile, src, usemap
- Specific Values Types
Caption alignment - specifies how/where to align a table caption
Related Attributes: caption
Default Values
While web page authors do not have to specify all possible attributes for every HTML tag on their page, the web browser must have or use some value for each of the attributes to determine how to render the viewable sections of the page. In the cases where not all of the attributes are specified, default values are used as described below:
- #FIXED
A fixed attribute cannot be changed. Whether or not the author places the attribute in the HTML element or not, the value must be the fixed value specified by the DTD. This is similar to a const in many programming languages.
- #IMPLIED
An implied attribute is optional. The author does not have to specify or include this value in the HTML element. It is up to the web browser to determine what value to use by default for this missing attribute. This accounts for most of the differences in how pages look in different browsers.
- #REQUIRED
A required attribute must be specified in the HTML element. Failure to include the attribute will cause the page not to validate correctly, and might cause an error in the browser. In other words, no default is actually provided - the author must give one.
- Value
Sometimes a single value will be specified as the default. While similar to #IMPLIED, in this case the browser does not have an option, and must use this specific default value if the author does not specify one.
Attribute Names
Below is a listing of all the valid attributes for HTML 4.01. Because the same attribute name can be used in different HTML tags to mean different things, some attributes have more than one description. Each attributes lists the name, a description, the type, related HTML tag(s), default value, and whether it is deprecated.
- abbr
-
abbreviation for table header cell
Type: Text
Related HTML Tags: td, th
Default Value: #IMPLIED
- accept
-
list of MIME types for file upload
Type: ContentTypes
Related HTML Tags: form, input
Default Value: #IMPLIED
- accept-charset
-
list of supported character sets
Type: Charsets
Related HTML Tags: form
Default Value: #IMPLIED
- accesskey
-
accessibility key character
Type: Character
Related HTML Tags: a, area, button, input, label, legend, textarea
Default Value: #IMPLIED
- action
-
server-side form handler
Type: URI
Related HTML Tags: form
Default Value: #REQUIRED
- align
-
caption alignment relative to table (deprecated)
Type: CAlign
Related HTML Tags: caption
Default Value: #IMPLIED
vertical or horizontal alignment of an object (deprecated)
Type: IAlign
Related HTML Tags: applet, iframe, img, input, object
Default Value: #IMPLIED
legend alignment relative to fieldset (deprecated)
Type: LAlign
Related HTML Tags: legend
Default Value: #IMPLIED
table position relative to window
Type: TAlign
Related HTML Tags: table
Default Value: #IMPLIED
alignment within table cells
Type: Custom (left | center | right | justify | char)
Related HTML Tags: col, colgroup, tbody, td, tfoot, th, thead, tr
Default Value: #IMPLIED
block element alignment (deprecated)
Type: Custom (left | center | right | justify)
Related HTML Tags: div, h1, h2, h3, h4, h5, h6, p
Default Value: #IMPLIED
horizontal rule alignment (deprecated)
Type: Custom (left | center | right)
Related HTML Tags: hr
Default Value: #IMPLIED
- alink (deprecated)
-
color of selected links
Type: Color
Related HTML Tags: body
Default Value: #IMPLIED
- alt
-
short description (deprecated)
Type: Text
Related HTML Tags: applet
Default Value: #IMPLIED
short description
Type: Text
Related HTML Tags: area, img
Default Value: #REQUIRED
short description
Type: CDATA
Related HTML Tags: input
Default Value: #IMPLIED
- archive
-
comma-separated archive list (deprecated)
Type: CDATA
Related HTML Tags: applet
Default Value: #IMPLIED
space-separated list of URIs
Type: CDATA
Related HTML Tags: object
Default Value: #IMPLIED
- axis
-
comma-separated list of related headers
Type: CDATA
Related HTML Tags: td, th
Default Value: #IMPLIED
- background (deprecated)
-
texture tile (image) for document background
Type: URI
Related HTML Tags: body
Default Value: #IMPLIED
- bgcolor (deprecated)
-
document background color
Type: Color
Related HTML Tags: body
Default Value: #IMPLIED
background color for cells
Type: Color
Related HTML Tags: table
Default Value: #IMPLIED
cell background color
Type: Color
Related HTML Tags: td, th
Default Value: #IMPLIED
background color for row
Type: Color
Related HTML Tags: tr
Default Value: #IMPLIED
- border
-
link border width (deprecated)
Type: Pixels
Related HTML Tags: img, object
Default Value: #IMPLIED
controls frame width around table
Type: Pixels
Related HTML Tags: table
Default Value: #IMPLIED
- cellpadding
-
spacing within cells
Type: Length
Related HTML Tags: table
Default Value: #IMPLIED
- cellspacing
-
spacing between cells
Type: Length
Related HTML Tags: table
Default Value: #IMPLIED
- char
-
alignment character; useful for lining up tables of numbers on the decimal point
Type: Character
Related HTML Tags: col, colgroup, tbody, td, tfoot, th, thead, tr
Default Value: #IMPLIED
- charoff
-
offset for alignment char
Type: Length
Related HTML Tags: col, colgroup, tbody, td, tfoot, th, thead, tr
Default Value: #IMPLIED
- charset
-
character encoding of linked resource
Type: Charset
Related HTML Tags: a, link, script
Default Value: #IMPLIED
- checked
-
for radio buttons and checkboxes
Type: Custom (checked)
Related HTML Tags: input
Default Value: #IMPLIED
- cite
-
URI for source document or message
Type: URI
Related HTML Tags: blockquote, q
Default Value: #IMPLIED
info on reason for change
Type: URI
Related HTML Tags: del, ins
Default Value: #IMPLIED
- class
-
space-separated list of classes
Type: CDATA
Related HTML Tags: all elements except base, basefont, head, html, meta,
param, script, style, title
Default Value: #IMPLIED
- classid
-
identifies an implementation (usually source code)
Type: URI
Related HTML Tags: object
Default Value: #IMPLIED
- clear (deprecated)
-
control of text flow following a line break
Type: Custom (left | all | right | none)
Related HTML Tags: br
Default Value: "none"
- code (deprecated)
-
applet class file
Type: CDATA
Related HTML Tags: applet
Default Value: #IMPLIED
- codebase
-
optional base URI for applet (deprecated)
Type: URI
Related HTML Tags: applet
Default Value: #IMPLIED
base URI for classid, data, or archive
Type: URI
Related HTML Tags: object
Default Value: #IMPLIED
- codetype
-
content type for source code
Type: ContentType
Related HTML Tags: object
Default Value: #IMPLIED
- color (deprecated)
-
text color
Type: Color
Related HTML Tags: basefont, font
Default Value: #IMPLIED
- cols
-
list of lengths for frameset
Type: MultiLengths
Related HTML Tags: frameset
Default Value: #IMPLIED
number of text columns in a textarea
Type: NUMBER
Related HTML Tags: textarea
Default Value: #REQUIRED
- colspan
-
number of columns spanned by cell
Type: NUMBER
Related HTML Tags: td, th
Default Value: "1"
- compact (deprecated)
-
reduced inter-item spacing, display list in a compact manner
Type: Custom (compact)
Related HTML Tags: dir, dl, menu, ol, ul
Default Value: #IMPLIED
- content
-
associated information about the document
Type: CDATA
Related HTML Tags: meta
Default Value: #REQUIRED
- coords
-
for use with client-side image maps
Type: Coords
Related HTML Tags: a
Default Value: #IMPLIED
comma-separated list of lengths definint a shape
Type: Coords
Related HTML Tags: area
Default Value: #IMPLIED
- data
-
reference to object's data
Type: URI
Related HTML Tags: object
Default Value: #IMPLIED
- datetime
-
date and time of change
Type: Datetime
Related HTML Tags: del, ins
Default Value: #IMPLIED
- declare
-
declare but don't instantiate flag
Type: Custom (declare)
Related HTML Tags: object
Default Value: #IMPLIED
- defer
-
user agent may defer execution of script
Type: Custom (defer)
Related HTML Tags: script
Default Value: #IMPLIED
- dir
-
direction for weak/neutral text
Type: Custom (ltr | rtl)
Related HTML Tags: all elements except applet, base, basefont, bdo, br,
frame, frameset, iframe, param, script
Default Value: #IMPLIED
directionality
Type: Custom (ltr | rtl)
Related HTML Tags: bdo
Default Value: #REQUIRED
- disabled
-
unavailable in this context
Type: (disabled)
Related HTML Tags: button, input, optgroup, option, select, textarea
Default Value: #IMPLIED
- enctype
-
encoding type
Type: ContentType
Related HTML Tags: form
Default Value: "application/x-www-form-urlencoded"
- face (deprecated)
-
comma-separated list of font names
Type: CDATA
Related HTML Tags: basefont, font
Default Value: #IMPLIED
- for
-
matches field related ID value
Type: IDREF
Related HTML Tags: label
Default Value: #IMPLIED
- frame
-
which parts of frame to render
Type: TFrame
Related HTML Tags: table
Default Value: #IMPLIED
- frameborder
-
request frame borders
Type: Custom (1 | 0)
Related HTML Tags: frame, iframe
Default Value: "1"
- headers
-
list of id's for header cells
Type: IDREFS
Related HTML Tags: td, th
Default Value: #IMPLIED
- height
-
initial applet height (deprecated)
Type: Length
Related HTML Tags: applet
Default Value: #REQUIRED
frame height
Type: Length
Related HTML Tags: iframe
Default Value: #IMPLIED
override height
Type: Length
Related HTML Tags: img, object
Default Value: #IMPLIED
height for cell (deprecated)
Type: Length
Related HTML Tags: td, th
Default Value: #IMPLIED
- href
-
URI for linked resource
Type: URI
Related HTML Tags: a, area, link
Default Value: #IMPLIED
URI that acts as base URI
Type: URI
Related HTML Tags: base
Default Value: #IMPLIED
- hreflang
-
language code for linked resource
Type: LanguageCode
Related HTML Tags: a, link
Default Value: #IMPLIED
- hspace (deprecated)
-
horizontal gutter
Type: Pixels
Related HTML Tags: applet, img, object
Default Value: #IMPLIED
- http-equiv
-
HTTP response header name
Type: NAME
Related HTML Tags: meta
Default Value: #IMPLIED
- id
-
document-wide unique id
Type: ID
Related HTML Tags: all elements except base, head, html, meta, script, style, title
Default Value: #IMPLIED
- ismap
-
use server-side image map
Type: Custom (ismap)
Related HTML Tags: img, input
Default Value: #IMPLIED
- label
-
for use in hierarchical drop-down menus
Type: Text
Related HTML Tags: optgroup
Default Value: #REQUIRED
for use in hierarchical drop-down menus
Type: Text
Related HTML Tags: option
Default Value: #IMPLIED
- lang
-
language code
Type: LanguageCode
Related HTML Tags: all elements except applet, base, basefont, br, frame, frameset, iframe, param, script
Default Value: #IMPLIED
- language (deprecated)
-
predefined script language name (e.g., "VBScript")
Type: CDATA
Related HTML Tags: script
Default Value: #IMPLIED
- link (deprecated)
-
color of links
Type: Color
Related HTML Tags: body
Default Value: #IMPLIED
- longdesc
-
link to long description (complements title)
Type: URI
Related HTML Tags: frame, iframe
Default Value: #IMPLIED
link to long description (complements alt)
Type: URI
Related HTML Tags: img
Default Value: #IMPLIED
- marginheight
-
margin height in pixels
Type: Pixels
Related HTML Tags: frame, iframe
Default Value: #IMPLIED
- marginwidth
-
margin widths in pixels
Type: Pixels
Related HTML Tags: frame, iframe
Default Value: #IMPLIED
- maxlength
-
maximum number of characters for text fields
Type: NUMBER
Related HTML Tags: input (type text only)
Default Value: #IMPLIED
- media
-
describes the media type this link is meant to be viewed on
Type: MediaDesc
Related HTML Tags: link
Default Value: #IMPLIED
designed for use with these media
Type: MediaDesc
Related HTML Tags: style
Default Value: #IMPLIED
- method
-
HTTP method used to submit the form
Type: Custom (GET | POST)
Related HTML Tags: form
Default Value: GET
- multiple
-
allows multiple selection of items in a list
Type: Custom (multiple)
Related HTML Tags: select
Default Value: #IMPLIED
- name
-
named link end (bookmark or inner-document link)
Type: CDATA
Related HTML Tags: a
Default Value: #IMPLIED
allows applets to find each other (deprecated)
Type: CDATA
Related HTML Tags: applet
Default Value: #IMPLIED
name of form field for scripting
Type: CDATA
Related HTML Tags: button, textarea
Default Value: #IMPLIED
name of form for scripting
Type: CDATA
Related HTML Tags: form
Default Value: #IMPLIED
name of frame for targetting
Type: CDATA
Related HTML Tags: frame, iframe
Default Value: #IMPLIED
name of image for scripting
Type: CDATA
Related HTML Tags: img
Default Value: #IMPLIED
submit as part of form
Type: CDATA
Related HTML Tags: input, object
Default Value: #IMPLIED
for reference by usemap
Type: CDATA
Related HTML Tags: map
Default Value: #REQUIRED
property name
Type: CDATA
Related HTML Tags: param
Default Value: #REQUIRED
field name
Type: CDATA
Related HTML Tags: select
Default Value: #IMPLIED
metainformation name
Type: NAME
Related HTML Tags: meta
Default Value: #IMPLIED
- nohref
-
this region of an image map has no action
Type: Custom (nohref)
Related HTML Tags: area
Default Value: #IMPLIED
- noresize
-
allow users to resize frames?
Type: Custom (noresize)
Related HTML Tags: frame
Default Value: #IMPLIED
- noshade (deprecated)
-
use a 3D effect?
Type: Custom (noshade)
Related HTML Tags: hr
Default Value: #IMPLIED
- nowrap (deprecated)
-
suppress word wrap
Type: Custom (nowrap)
Related HTML Tags: td, th
Default Value: #IMPLIED
- object (deprecated)
-
serialized applet file
Type: CDATA
Related HTML Tags: applet
Default Value: #IMPLIED
- onblur
-
the element lost the focus
Type: Script
Related HTML Tags: a, area, button, input, label, select, textarea
Default Value: #IMPLIED
- onchange
-
the element value was changed
Type: Script
Related HTML Tags: input, select, textarea
Default Value: #IMPLIED
- onclick
-
a pointer button was clicked
Type: Script
Related HTML Tags: all elements except applet, base, basefont, bdo, br, font, frame, frameset, head, html, iframe, isindex, meta, param, script, style, title
Default Value: #IMPLIED
- ondblclick
-
a pointer button was double clicked
Type: Script
Related HTML Tags: all elements except applet, base, basefont, bdo, br, font, frame, frameset, head, html, iframe, isindex, meta, param, script, style, title
Default Value: #IMPLIED
- onfocus
-
the element got the focus
Type: Script
Related HTML Tags: a, area, button, input, label, select, textarea
Default Value: #IMPLIED
- onkeydown
-
a key was pressed down
Type: Script
Related HTML Tags: all elements except applet, base, basefont, bdo, br, font, frame, frameset, head, html, iframe, isindex, meta, param, script, style, title
Default Value: #IMPLIED
- onkeypress
-
a key was pressed and released
Type: Script
Related HTML Tags: all elements except applet, base, basefont, bdo, br, font, frame, frameset, head, html, iframe, isindex, meta, param, script, style, title
Default Value: #IMPLIED
- onkeyup
-
a key was released
Type: Script
Related HTML Tags: all elements except applet, base, basefont, bdo, br, font, frame, frameset, head, html, iframe, isindex, |