Index: > A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Business Industries Finance Tax

Home > HTML element


First Prev [ 1 2 3 4 ] Next Last

This article is about HTML elements. For information on how to format Wikipedia entries, see How to edit a page and

In computing, an HTML element (instance) in terms of SGML is the complete sequence of a start tag (with attributes and their value s), any embedded HTML content, and the end tag. A special case is empty element s that don't have contents and end tags. Due to the constraints of the DTDs, various parts, including start and end tag, may be omitted in HTML, but not XHTML. In XHTML the minimized tag syntax for an empty element (abbreviated form of the combination of opening and closing tag) is e.g.
.

Informally, HTML elements or their attributes are often simply called "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.

1 Nesting

Many HTML elements can be "nested":

Yourock!

has an em element nested inside a p element. This can become more complex, for example

1 Children that do not clean up their rooms

. Nesting may be arbitrarily deep. Tags must be closed in the reverse order that they've been opened.
Wrong:

Lucy kissed Jimmy

Right:

Lucy kissed Jimmy

Nesting is restricted partly on the basis of whether an element is block-level or inline. A block-level element typically begins on a new line, while an inline element typically does not; a block-level element may contain other block-level elements or inline elements, while an inline element may only contain other inline elements. Examples of block-level elements include paragraphs, lists, tables, headings, and the div generic container element. Examples of inline elements include structured text such as emphasis, citations, or abbreviations, as well the span generic container element.

1.1 Header tags

...
Delimit a HTML document (i.e. instead of an XML or another class document).
...
Delimit the header section of the document, which contains information about the page.
...
Delimit the body section of the document, which contains the displayed content of the page.
...
Delimit the page title. Depending on the user agent and the operating system it is rendered in various ways: in web browsers it is usually displayed in the browser's title bar; in the task bar when the window has been minimized; it can be taken as default for the name of the file when saving the page, etc.. The title element is special in that it cannot contain any other tags: all tags in the title must be rendered as if they are text. So My <b>first</b></code> webpage will render as "My first webpage", and not "My first webpage".
...
Delimit metadata, and can be used to specify a page description, keywords, and the special form , used to specify commands which should be sent as HTTP headers.
Specifies any link types for the document, such as previous and next links, or alternate versions. Its most common use is to link an external stylesheet to the page, in the form:
(XHTML: )
Specifies base values for links, such as location or target.
Used to include Javascript or other scripts in the document.
Used to specify a style for the document, usually:
with style data or references such as:
/*url "; @import "url "; /*]]>*/

1.2 Body tags

All body tags are block-level elements, and cannot be contained within an inline element.

1.2.1 Headings

2

through
2.1.1
Section headings at different levels. Use h1 for the highest-level heading (for example the document title), h2 for a lower-level heading (a major section), h3 for a level below that (for example a subsection), etc. The lowest level heading is h6. Most web browsers will show h1 as large text in a different font, and h6 as small boldfaced text, but this can be overridden with CSS. The heading elements are not intended merely for creating large or bold text.