Skip to main content
Glossary Term

HTML element

HTML Elements and Structure - HTML elements are components of HTML documents. - HTML elements can add semantics and formatting to parts of a document. - Elements can have attributes specified. - Elements can have content, including other elements and text. - HTML documents are composed of a tree of HTML nodes. - Most HTML elements are written with a start tag and an end tag. - Some elements, called void elements, do not have an end tag. - Void elements have predefined behavior and cannot contain content or other elements. - XHTML requires opening and closing all elements, including void elements. - An alternative way to specify a void element is to use a self-closing tag. - The root element of an HTML document is the HTML element. - The HTML element delimits the beginning and end of an HTML document. - The head element contains metadata about the document. - The body element contains the visible content of the document. - The title element specifies the title of the document. Elements vs. Tags and SGML vs. XML - The position of an element is indicated by start and end tags. - The distinction between elements and tags is emphasized in HTML specifications. - Certain tags can be omitted, but the element is still present. - HTML parsing depends on the Document Type Definition (DTD). - The DTD specifies the valid combinations of elements in a document. - SGML is complex, while XML is a simpler alternative. - XML parsing is simpler than SGML parsing. - HTML on the web is often treated as XML (XHTML) or HTML5. - Parsing document tags into DOM elements is simplified in XML and HTML5. CSS and Block Elements - CSS defines block elements with the 'display: block;' declaration. - HTML has %block; and %inline; groups for block-level and inline elements. - Block-level elements cannot be placed into an inline context. - Block and inline elements have different CSS behaviors by default. - CSS behavior can be changed from the default for specific elements. - Block elements have a rectangular structure and can span the entire width of their parent element. - Block elements have content, padding, border, and margin, forming the box model. HTML Element Standards and Status - HTML elements are defined in a series of open standards issued since 1995. - User agents often developed their own elements during the browser wars of the 1990s. - XML introduced mechanisms to allow anyone to develop their own elements and incorporate them in XHTML documents. - HTML 4.01 was rewritten in an XML-compatible form called XHTML 1.0. - XHTML 1.0 documents are valid or nearly valid HTML 4.01 documents. - Several elements have become deprecated or invalid in later standards. - HTML 4.01 / XHTML 1.0 introduced three types of DTD: Transitional, Frameset, and Strict. - HTML5 provides a listing of obsolete features, both conforming and non-conforming. - The frame elements are highly problematic for user accessibility. - XHTML 1.1 does not include frames at all. Additional HTML Elements - HTML elements can be written in any combination of upper or lower case, but must be in lower case in XHTML. - There are three kinds of HTML elements: normal elements, raw text elements, and void elements. - Void elements only have a start tag and may not contain any children. - Boolean attributes do not require a value to be specified. - HTML allows replacement content for non-visual user agents and can be extended through scripts. - The document head elements include base, basefont (deprecated), isindex (deprecated), link, and meta. - The document body elements include block elements, inline elements, basic text elements, lists, and images. - The basic text elements include p element for paragraphs and h1-h6 elements for section headings. - The list elements include dl for description lists, ul for unordered lists, and ol for ordered lists. - The definition list elements include dt and dd. - Other block elements include address, article, aside, blockquote, and div. - Additional block elements include figure, figcaption, footer, header, and hr.