The primary purpose of HTML tags is to specify the structure of a web page.
Elements are either block-level or inline. A block-level element is like a paragraph; it is a container that can be filled with other elements. Most block-level elements can contain any other sort of element. An inline element is like a word within a paragraph; it is a small component that is arranged with other components inside a container. An inline element usually only contains text.
The content of an element may be other elements or plain text. There is a limit on which elements may be nested within other elements (see Section 3.3).
Almost all elements may have a class attribute, so that a CSS style specified in the head element can be associated with that element. Similarly, all elements may have an id attribute, which can be used to associate a CSS style. The value of all id attributes within a piece of HTML code must be unique.
All elements may also have a style attribute, which allows “inline” CSS rules to be specified within the element's opening tag.
Paul Murrell
This document is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 License.