Content deleted Content added
→Frames: {{cleanup}} |
clarification of inline/block-level elements |
||
Line 1:
In [[computing]], an '''HTML element''' (instance) in terms of [[SGML]] is the complete sequence of a start ''tag'' (with [[attribute]]s and their [[attribute value|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 [[Document Type Definition|DTD]]s, 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.
Line 5:
=="Nesting"==
Most but not all HTML elements can be "nested": <code><p><em>You</em>rock!</p></code> has an <code>em</code> element nested inside a <code>p</code> element. This can become more complex, for example <code><h1>Children that <em>do <font color="red">not</font> clean up</em> their rooms</h1></code>. Nesting may be arbitrarily deep. Tags must be closed in the reverse order that they've been opened.
;Wrong:
Line 13 ⟶ 11:
;Right:
:<code><p><font face="Tahoma">Lucy kissed <em>Jimmy</em></font></p></code>
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 <code>div</code> generic container element. Examples of inline elements include include structured text such as emphasis, citations, or abbreviations, as well the <code>span</code> generic container element.
==Header tags==
|