, this section may be repeated by the user agent if the table is split across pages (in printing or other paged media)

top

Forms
These elements can be combined into a form or used separately as user-interface controls. Combined with a first-class javascript engine, these controls provide support for rich user interfaces.


HTML specifies the elements that make up a form, and the method by which it will be submitted. However, some form of script either server-side or client side must be used to process the user's input once it is submitted.


Creates a form.



Create a menu list, from which the user can select a single option. May be rendered as a dropdown menu.



Creates a menu item in a menu list.



Creates a checkbox. Can be checked or unchecked.



Creates a radio button. If multiple radio buttons are given the same name, the user will only be able to select one of them from this group.



Creates a general-purpose button. But it's advised to use



Creates a submit button.



Creates a button using an image. The image URL may be specified with the src tag.



Creates a reset button for resetting the form to default values.



Creates a one-line text input. The size attribute specifies the default width of the input in character-widths. Maxlength sets the maximum number of characters the user can enter (which may be greater than size).



Creates a variation of one-line text input. The only difference is that inputted text is masked: usually every character is shown as an asterisk or a dot. It should be noted, however, that the value is submitted to the server as clear text. So an underlying secure transport layer like HTTPS is needed if confidentiality is a matter.



Creates a label for a form input (e.g. radio button). Clicking on the label toggles the control.



Create a multiple-line text area, the size of which is specified by cols and rows attributes. Text in between the tags appears in the text area when the page is loaded.


top

Frames

An HTML document may contain a header and a body or a header and a frameset, but not both. For frames the Frames DTD must be used.


Delimit the frameset. The frames layout is given by comma separated lists in the rows and cols attributes.



Delimit a single frame, or region, within the frameset. A different document linked with the src attribute appears inside.



Contains a normal element with child elements that will appear in web browsers that don't support frames.



An inline frame inside a normal HTML , which embeds another HTML document. A similar effect can also be achieved using the object element. These approaches differ in some ways (World Wide Web Consortium *).


See also Framing (World Wide Web).

top

Official
The use of presentational markup is discouraged. The equivalent CSS should be used instead. Deprecated elements are only valid in the Transitional and Frameset variants of HTML 4.01 and XHTML1.0. They are invalid in the Strict variants of HTML 4.01, XHTML1.0 and XHTML 1.1. and are invalid in the current draft of XHTML2.0.


Creates a block-level centered division. May also center-align all text. Deprecated in favor of
or another element with centering defined using CSS.



Use boldface type. Equivalent CSS:



Use italic type. Equivalent CSS:



Creates bigger text. Equivalent CSS: .



Creates smaller text. Equivalent CSS:




Create strike-through text: Strikethrough Equivalent CSS:



Use a typewriter-like (fixed-width) font. Equivalent CSS:



Use an underlined font. Equivalent CSS:

color=color, size=size, face=face>… (deprecated)

Can specify the font color with the color attribute, typeface with the face attribute, and absolute or relative size with the size attribute.

Examples (all the examples are deprecated, use CSS equivalents if possible):
Equivalent CSS for font attributes:

top

Unofficial
These are unofficial presentational elements that may not be supported in all browsers.

(unofficial)

Causes text to blink. Can be done with CSS where supported:

(unofficial)

Creates scrolling text. No equivalent with CSS; use scripting instead.

(unofficial)


Causes text to not return at end of line. Can be done with CSS:


top

HTML Comment

Encloses a comment. This is an SGML tag and not limited to HTML, so it may appear anywhere in the document, even before the DTD or after . A client should render none of its enclosed contents. The closing ">" is required. For compatibility with some pre-1995 browsers, SGML comments are sometimes used inside
  Navigation
  • Home
  • Recent
  • Most Active
  • Popular
  • Blog
  • Credits
  • RSS
  •   Interaction
  • Register
  • Statistics
  •   Help
  • Suggestions
  • Contact Us
  • How to Edit
  • Help



  • [Edit]



    In computing, an HTML element indicates structure in an HTML document and a way of hierarchically arranging content. More specifically, an HTML element is an SGML element that meets the requirements of one or more of the HTML Document Type Definitions (DTDs). These elements have properties: both attributes and content, as specified (both allowable and required) according to the appropriate HTML DTD (for example, the HTML 4.01 strict DTD). Elements may represent headings, paragraphs, hypertext links, lists, embedded media, and a variety of other structures.


    Syntactically HTML elements are constructed with: 1) a start tag marking the beginning of an element; 2) any number of attributes (and their associated values); 3) some amount of content (characters and other elements)'; and 4) an end tag. Many HTML elements include attributes in their start tags, defining desired behavior or indicating additional element properties. The end tag is optional for many elements; in a minimal case, an empty element has no content and requires no end tag. There are a few elements that are not part of any official DTDs, yet are supported by some browsers and used by some web pages. Such elements may be ignored or displayed improperly on browsers not supporting them.

    Informally, HTML elements are sometimes referred to as "tags" (an example of synecdoche), though many prefer the term tag strictly in reference to the semantic structures delimiting the start and end of an element.

    XHTML is the successor to HTML 4.01; XHTML 1.0 supports the same elements as HTML 4 and in most cases valid XHTML 1.0 documents will be valid or nearly valid HTML 4 documents. XHTML 1.0 migrates HTML from its SGML underpinnings to an XML foundation. Accordingly, the discussion of elements within this article focuses on the final SGML based HTML, version 4.01 (unless noted otherwise). However, to the extent that XHTML 1.0 elements remain identical to the HTML 4.01 elements, the discussion remains applicable (see HTML for a discussion of the minor differences in content between XHTML 1.0 and HTML 4.01).


        HTML element
            Block-level and inline elements
                Nesting of elements
            Document elements
            Head elements
            Inline
                General phrase elements
                Computer code phrase elements
                Special inline elements
                Links and anchors
                Images and objects
                Span element
            Block
                General block elements
                Headings
                Tables
                Forms
            Frames
                Official
                Unofficial
            HTML Comment

    top

    Block-level and inline elements

    HTML elements are classified as either block-level or inline (text-level).

    Block-level elements — such as headings, paragraphs, lists, or tables — are "large" structures containing other blocks, inline elements, or text (but see nesting rules, below). They are usually displayed as independent "blocks" separated from other blocks by vertical space (margins).

    Inline or text-level elements — such as hyperlinks, citations, quotations, or images — are "small" structures that represent or describe small pieces of text or data. They may contain only text or other inline elements, and are usually displayed one after another on a line within the block that contains them.

    (See "The global structure of an HTML document")

    top

    Nesting of elements

    Many HTML elements can be nested, or contained within other HTML elements:

    You rock



    Nesting can be more complex:

    King Louis said, L'état, c'est moi! (Wikipedia).



    Nesting may be arbitrarily deep, but the elements must be closed in the reverse order that they were opened for the code to remain valid (this pattern is known as Last in, first out).

    Incorrect:

    Mary kissed Jimmy


    Correct:

    Mary kissed Jimmy



    Some block-level elements (e.g. paragraphs) may contain only inline elements, and some (e.g. forms, lists) must contain only block-level child elements, but most may contain either block-level or inline elements.

    top

    Document elements

    Root elements provide the containers enclosing all other HTML elements. Every HTML page has these elements. The surrounding tags may be omitted. However, some utilities may not recognize or correctly handle the document if this is done.


    Delimit an HTML document (i.e. instead of an XML or another class document). The HTML element takes the attributes lang for the primary language for the document (such as en for English) and a profile for a URI specifying metadata for the document (rarely used). The only contents allowed in an HTML element is one head element and one body element. (See Frames, below, for an exception where body is not used.)



    Delimit the header section of the document, which contains information about the page. The head element basically contains the metadata for the document. There are seven possible head elements including a meta element for extensible specification of metadata.



    Delimit the body section of the document, which contains the displayed content of the page.


    These root elements are arranged as follows:



    Any of the various head related elements arranged in any order and occurring any number of times except base and title which can only occur once each. Title is the only required head element.



    At least one of either a block element or a script element must occur,(though any number may occur), arranged in any order to suit the meaning and also typically the presentation of the document. The ins and del elements are also permissible within the body element when used as block level elements. The other block elements are: paragraph (p), heading (h1...h6), block quotation (blockquote), ordered list (ol), unordered list (ul), definition list (dl), division (div), no script support (noscript), form (form), table (table), fieldset (fieldset), and address (address). No other HTML elements are valid within the body element.




    top

    Head elements


    Define a document title. This element is required in every HTML and XHTML document. Different user agents may make use of the title in different ways. Web browsers usually display it in the title bar when the window is open, and in the task bar when it is minimized. It may become the default filename when saving the page, Search engines' web crawlers may pay particular attention to the words used in the title element. The title element must not contain any nested tags (in other words it cannot contain any other elements). Only one title element is permitted in a document.



    Specifies a base URL for all relative href and other links in the document. Must appear before any element that refers to an external resource. HTML permits only one base element for each document. The base element has attributes, but no contents.



    Specifies links to other documents, such as 'previous' and 'next' links, or alternate versions *. An HTML head may contain any number of link elements. The link element has attributes, but no contents. A common use is to link to external stylesheets, using the form:

    *



    Specifies a base font size, typeface and color of the document. Used together with font elements. Deprecated in favor of stylesheets.



    Used to add JavaScript or other scripts to the document. The script code may be literally typed between the script tags and/or it may be in a separate resource whose URL is specified in script's optional src attribute. *



    Specifies a style for the document, usually:


    The CSS statements may be literally typed between the style tags and/or it may be in separate resources whose URLs are specified in @import directives such as:

    . *



    Use for including generic objects within the head. Though rarely used as a head element, this could potentially be used to extract foreign data, relevant to the document, and associate this data with the current document.



    Delimit metadata, and can be used to specify a page description, keywords, and any other metadata not provided through the other head elements and attributes. A special form is used to specify commands which should be sent over the HTTP protocol: the typical method of transporting HTML documents. For example:



    Because of their generic nature, the meta element is possibly the most diverse and complicated of all the elements. Consider the specification of a keyword meta element: However it accomplishes the task through a common protocol called key value coding. The element specifies two main attributes: a name (a key or property) and the associated content (or value) for that name. Because the meanings associated with these properties may be ambigous, a third option attribute may be specified: schema. The schema attribute provide a reference to an established semantic protocol for understanding the meanings of the names and associated values. For example


    In this example, the meta element identifies itself as containing a keyword. The keyword is "key word". And it uses the DC or Dublin Core scheme to define the meaning of the other attributes.


    top

    Inline

    Inline elements cannot be placed directly inside the body element for valid HTML. They must be wholly nested within block-level elements (see block elements below).

    top

    General phrase elements


    Emphasis (conventionally displayed in italics)



    strong emphasis (conventionally displayed bold). An oral user agent may use different voices for emphasis.



    An quotation containing only inline elements (for quotations containing block level elements see blockquote below). Quote elements may be nested. By the specification, the author should not include quotation marks. Rather, quotation marks — including nested quotation marks — should be rendered through stylesheet properties or the browser's default stylesheet. Practical concerns due to browser non-compliance may force authors to find work-arounds. The cite attribute gives the source, and must be a fully qualified URI.


    Note: within semantic HTML, the display of a lengthy inline quotation as an indented block should be handled through stylesheet presentation. One method is to use an XSLT to select quotation elements exceeding a certain length (in terms of characters or words, etc.) for indented block presentation. An alternative, using Cascading Stylesheets, requires some presentational markup to manually classify the element as a lengthy quotation. For example:


    An inline quotation of significant length (say 25 words, for example) goes here....



    A citation. Reference for a quote or statement in the document.



    Defining first instance of a term



    Contains an abbreviation like HTML



    Contains an acronym similar to the abbr element.


    top

    Computer code phrase elements
    These elements are useful primarily for documenting computer code development and user interaction through differentation of source code (), source code variables (), user input (), and terminal output ().


    A code snippet. Conventionally rendered in a monospace font: Code snippet.



    Sample output (from a program or script)



    Keyboard - text to be entered by the user



    Variable


    top

    Special inline elements


    Create subscript or superscript text: Equivalent CSS: or



    Deleted text. Typically rendered as a strikethrough: Deleted text.



    Inserted text. Often used to markup replacement text for 'd text. Typically rendered underlined: Inserted text.


    Note, both ins and del elements may be used as block elements: containing other block and inline elements. However, these elements must still remain wholly within their parent element to maintain a well-formed HTML document). For example deleting text from the middle of one paragraph across several other paragraph and ending in a final paragraph would need to use three separate del elements. Two del elements would be required as inline element to indicate the deletion of text in the first and last paragraphs, and a third, used as a block element, to indicate the deletion in the intervening paragraphs.



    The
    isindex element requires server side support for indexing documents. Visually presents a one-line text input for keyword entry. When submitted, the query string is appended to the current URL and the document is displayed with these keywords highlighted. Generally if the server supports this feature it will add the iisindex elements to documents without author intervention.


    top

    Links and anchors


    Creates an element that becomes a hyperlink with the href attribute set to a URL; additionally the attribute title may be set to a hover box text, some informative text about the link:


    In most graphical browsers, when the cursor hovers over the link, the cursor typically changes into a hand with a stretched index finger and the additional information pops up, not in a regular window, but in a special "hover box", usually similar to a Tooltip, which disappears when the cursor is moved away. Some browsers render alt text the same way, though this is technically incorrect.

    Alternatively (and sometimes concurrently), the element becomes an anchor with the name attribute set, which preceded by a number sign '
      ', and appended to the URL, acts as a link target (a "document fragment"), typically causing a Web browser to scroll directly to that point of the page. Any element can be made into an anchor by using the id attribute, so using is not necessary.
    See also:link


    top

    Images and objects


    Includes an image with the src attribute, the required alt provides alternative text in case the image cannot be displayed. Alt is intended as alternative text, although many browsers render it as a tooltip; the title attribute is the tooltip text.



    Specifies a line-break. Can also be done with CSS:



    Specifies a client-side image map.



    Specifies an area in the map.



    Includes an object in the page of the type specified by the type attribute. This may be in any MIME Type the webbrowser understands, such as an embedded page, code to be handled by a plug-in such as Flash, a Java applet, a sound file etc.



    This element may only appear inside an object element. Using attributes such as name and value, each sets a parameter for the object. Examples include width, height, font, background colour etc, depending what has been exposed in this way by the object's developers.

    (unofficial)

    Calls a plug-in handler for the type specified by the type attribute. Used for embedding Flash files, soundfiles etc. Not official; is preferred.
    (unofficial)

    Specifies alternative content, if the embed cannot be rendered.



    Includes a Java applet in the page. Deprecated; is now preferred.

    top

    Span element
    {{XMLElement|span|Span|…|}}

    Creates an inline logical division. This may be used to identify a part of the HTML page, for example so as to apply an id or class attribute, which can then be referenced from CSS or DOM call. Like most HTML elements, span also supports inline CSS in its optional style attribute).


    top

    Block

    Many HTML elements are designed for altering the semantic structure or meaning of a document. Some are block-level, but most are inline and can be included in the normal flow of text.

    top

    General block elements


    Creates a paragraph, perhaps the most common block level element. The closing tag is not required in HTML.


    Contains quoted material when the quotation itself includes block level elements (for instance, quoting several paragraphs). The cite attribute may give the source, and must be a fully qualified URI. The blockquote element is often misunderstood. It is an element meant to contain quotations that are themselves block level. In other words, it contains a complete paragraph or many paragraphs. In HTML strict DTDs inline elements are prohibited from blockquote elements. For quotations not containing block level elements see the quote (q) element.



    Inserts a horizontal rule. Horizontal rules can also be handled through the CSS properties.


    top

    Headings


    Section headings at different levels. Use

    for the highest-level heading (the major sections),

    for the next level down (sub-section),

    for a level below that, and so on. The lowest level heading is
    .



    Most web browsers will show

    as large text in a different font, and
    as small bold-faced text, but this can be overridden with CSS. The heading elements are not intended merely for creating large or bold text: they describe something about the document's structure and organization. Some programs use them to generate outlines and tables of contents.



    top

    Tables
    See also: Help:Table, Table (HTML)


    Creates a table



    Creates a row in the table.



    Creates a table header cell within a row; contents are conventionally displayed bold and centered. An aural user agent may use a louder voice for these items.



    Creates a table data cell within a row.



    Specifies a column group in a table.



    Specifies attributes for an entire column in a table.



    Specifies a caption for the entire table.



    Specifies the header part of a table. This section may be repeated by the user agent if the table is split across pages (in printing or other paged media).



    Specifies the main part of a table.



    Specifies the footer part of a table. Like