Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
HTML element
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{Short description|Individual component of an HTML document}} {{for|the usage of HTML on Wikipedia|Help:HTML in wikitext|selfref=y}} {{Redirect|nobr|the chemical compound|NOBr}} {{Redirect|Font color}} {{Use American English|date=March 2018}} {{Html series}} An '''HTML element''' is a type of [[HTML]] (HyperText Markup Language) document component, one of several types of HTML nodes (there are also text nodes, comment nodes and others).{{Vague|date=February 2019}} The first used version of HTML was written by [[Tim Berners-Lee]] in 1993 and there have since been many versions of HTML. The current de facto standard is governed by the industry group [[WHATWG]] and is known as the HTML Living Standard. An HTML document is composed of a [[tree structure|tree]] of simple HTML [[Node (computer science)|nodes]], such as text nodes, and HTML elements, which add [[semantics]] and formatting to parts of a document (e.g., make text bold, organize it into paragraphs, lists and tables, or embed [[hyperlink]]s and images). Each element can have [[HTML attribute]]s specified. Elements can also have content, including other elements and text. ==Concepts== [[File:HTML element content categories.svg|thumb|HTML element content categories]] ===Elements vs. tags=== As is generally understood, the position of an element is indicated as spanning from a start tag and is terminated by an end tag.<ref name="HTML401_Elements">{{Cite web |at=§3.2.1 Elements |title=§3 On SGML and HTML |work=HTML 4.01 Specification |date=24 December 1999 |url=http://www.w3.org/TR/1999/REC-html401-19991224/intro/sgmltut.html#h-3.2.1 |publisher=[[W3C]] }}</ref> This is the case for many, but not all, elements within an HTML document. The distinction is explicitly emphasised in ''HTML 4.01 Specification'': {{quote|'''Elements are not tags.''' Some people refer to elements as tags (e.g., "the P tag"). Remember that the element is one thing, and the tag (be it start or end tag) is another. For instance, the HEAD element is always present, even though both start and end HEAD tags may be missing in the markup.<ref name="HTML401_Elements"/>}} Similarly the W3C Recommendation '''''HTML 5.1 2nd Edition''''' explicitly says: {{quote| source=[https://www.w3.org/TR/html51/syntax.html#tags HTML 5.1 2nd Edition § 8.1.2. Elements § Tags] | '''Tags''' are used to delimit the start and end of elements in the markup. (...) The start and end tags of certain normal elements can be omitted, (...) <br/> The contents of the element must be placed between just after the start tag (which <u>might be implied</u>, in certain cases) and just before the end tag (which again, <u>might be implied</u>, in certain cases). }} and: {{quote| source=[https://www.w3.org/TR/html51/syntax.html#optional-tags HTML 5.1 2nd Edition § 8.1.2.4. Optional tags] | Certain tags can be '''omitted'''. <br/> '''NOTE:'''<br/> Omitting an element's start tag (...) does not mean the element is not present; it is implied, but it is still there. For example, an HTML document always has a root <kbd><nowiki><html></nowiki></kbd> element, even if the string <kbd><nowiki><html></nowiki></kbd> doesn't appear anywhere in the markup. }} As HTML (before HTML5) is based on [[SGML]],<ref>{{Cite web |at=§3.1 Introduction to SGML |title=§3 On SGML and HTML |work=HTML 4.01 Specification |date=24 December 1999 |url=http://www.w3.org/TR/1999/REC-html401-19991224/intro/sgmltut.html |publisher=[[W3C]] }}</ref> its parsing also depends on the [[Document Type Definition|Document Type Definition (DTD)]], specifically an HTML DTD (e.g. HTML 4.01<ref name="W3C, HTML 401 DTD" >{{Cite web |title=HTML 4.01, §21, Document Type Definition |date=24 December 1999 |url=http://www.w3.org/TR/1999/REC-html401-19991224/sgml/dtd.html |publisher=[[W3C]] }}</ref>{{refn|group=note|HTML 4.01 is one of a small number of well-known HTML DTDs. It is chosen here as the best illustrative example, although the same behavior applies to the other W3C-published DTDs for HTML.}}). The DTD specifies which element types are possible (i.e. it defines the set of element types) and also the valid combinations in which they may appear in a document. It is part of general SGML behavior that, where only one valid structure is {{em|possible}} (per the DTD), its explicit statement in any given document is not generally required. As a simple example, the {{code|lang=html|code=<p>}} tag indicating the start of a paragraph element should be complemented by a {{code|lang=html|code=</p>}} tag indicating its end. But since the DTD states that paragraph elements cannot be nested, an HTML document fragment {{code|lang=html|code=<p>Para 1 <p>Para 2 <p>Para 3 }} is thus inferred to be equivalent to {{code|lang=html|code=<p>Para 1 </p><p>Para 2 </p><p>Para 3 }}. (If one paragraph element cannot contain another, any currently open paragraph must be closed before starting another.) Because this implication is based on the combination of the DTD and the individual document, it is not usually possible to infer elements from document tags {{em|alone}} but only by using an SGML—or HTML—aware parser with knowledge of the DTD. [[HTML5]] creates a similar result by defining what tags can be omitted.<ref name=whatwg-syntax-tag-omission>{{cite web |title=HTML Standard § Optional tags |url=https://html.spec.whatwg.org/multipage/syntax.html#syntax-tag-omission |website=WHATWG |access-date=22 March 2019}}</ref> ===SGML vs. XML=== SGML is complex, which has limited its widespread understanding and adoption. [[XML]] was developed as a simpler alternative. Although both can use the DTD to specify the supported elements and their permitted combinations as document structure, XML parsing is simpler. The relation from tags to elements is always that of parsing the actual tags included in the document, without the implied closures that are part of SGML.{{refn|group=note|A macro-like feature of DTDs may still be used within XML.}} HTML as used on the current web is likely to be either treated as XML, by being [[XHTML]], or as [[HTML5]]; in either case the parsing of document tags into [[Document Object Model]] (DOM) elements is simplified compared to legacy HTML systems. Once the DOM of elements is obtained, behavior at higher levels of interface (example: screen rendering) is identical or nearly so.{{refn|group=note|One minor difference is that XML, even after the DOM interface, is case-sensitive.<ref>{{Cite web |at=§1.3. XHTML and the HTML DOM |work=Document Object Model (DOM) Level 2 HTML Specification |date=9 January 2003 |title=§1. Document Object Model HTML |url=http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html#ID-5353782642 |publisher=[[W3C]] }}</ref>}} ===<code>%block;</code> vs. box=== Part of this CSS presentation behavior is the notion of the "[[CSS box model|box model]]". This is applied to those elements that CSS considers to be "block" elements, set through the CSS {{code|lang=css|code=display: block;}} declaration. HTML also has a similar concept, although different, and the two are very frequently confused. <code>%block;</code> and <code>%inline;</code> are groups within the HTML DTD that group elements as being either "block-level" or "inline".<ref name="W3C, HTML 4.01, block and inline" >{{Cite web |at=§7.5.3 Block-level and inline elements |title=§7 The global structure of an HTML document |work=HTML 4.01 Specification |date=24 December 1999 |url=http://www.w3.org/TR/1999/REC-html401-19991224/struct/global.html#h-7.5.3 |publisher=[[W3C]] }}</ref> This is used to define their nesting behavior: block-level elements cannot be placed into an inline context.{{refn|group=note|However, see {{code|lang=html|code=<object>}} for the inevitable exception.}} This behavior cannot be changed; it is fixed in the DTD. Block and [[inline elements]] have the appropriate and different [[CSS]] behaviors attached to them by default,<ref name="W3C, HTML 4.01, block and inline" /> including the relevance of the box model for particular element types. Note though that this CSS behavior can, and frequently is, changed from the default. Lists with {{code|lang=html|code=<ul><li> ...}} are <code>%block;</code> elements and are presented as block elements by default. However, it is quite common to set these with CSS to display as an inline list.<ref>{{Cite web |title=CSS Design: Taming Lists |author=Mark Newhouse |date=27 September 2002 |url=http://alistapart.com/article/taminglists/ |publisher=[[A List Apart]] }}</ref> ==Overview== ===Syntax=== {{Image frame|caption=Parts of an HTML container element |content=<math> \overbrace{ \overbrace{\mathtt{\color{BrickRed}<\!p\ }\color{Magenta}\underbrace\mathtt{class}_\mathsf{\color{Black}{Attribute \atop name}}\mathtt{= ''}\!\underbrace\mathtt{paragraph}_\mathsf{\color{White}{Attr} \atop \color{Black}Attribute\ value}''\mathtt{\color{BrickRed}>}}^\mathsf{Start\ tag} \overbrace\mathtt{\color{Green}This\ is\ a\ paragraph.}^\mathsf{Content} \overbrace\mathtt{\color{BrickRed}<\!/p\!>}^\mathsf{End \atop tag} }^\mathsf{Element} </math> }} In the HTML syntax, most elements are written with a start tag and an end tag, with the content in between. An '''HTML tag''' is composed of the name of the element, surrounded by [[angle bracket]]s. An end tag also has a slash after the opening angle bracket, to distinguish it from the start tag. For example, a paragraph, which is represented by the {{tag|p|o}} element, would be written as: <syntaxhighlight lang="html"> <p>In the HTML syntax, most elements are written ...</p> </syntaxhighlight> However, not all of these elements {{em|require}} the end tag, or even the start tag, to be present.<ref name=whatwg-syntax-tag-omission/> <!--Examples will be given throughout the article when I get around to it. —Ms2ger--> Some elements, the so-called ''[[#Void elements|void elements]]'', do not have an end tag. A typical example is the {{tag|br|o}} (hard line-break) element. A void element's behavior is predefined, and it cannot contain any content or other elements. For example, an address would be written as: <syntaxhighlight lang="html"> <p>P. Sherman<br>42 Wallaby Way<br>Sydney</p> </syntaxhighlight> When using [[XHTML]], it is required to open and close all elements, including void elements. This can be done by placing an end tag immediately after the start tag, but this is not legal in HTML 5 and will lead to two elements being created. An alternative way to specify that it is a void element, which is compatible with both XHTML and HTML 5, is to put a <code>/</code> at the {{em|end}} of the tag (not to be confused with the <code>/</code> at the {{em|beginning}} of a closing tag). <syntaxhighlight lang="html"> <p>P. Sherman<br />42 Wallaby Way<br />Sydney</p> </syntaxhighlight> [[HTML attribute]]s are specified inside the start tag. For example, the {{tag|abbr|o}} element, which represents an [[abbreviation]], expects a <code>title</code> attribute within its opening tag. This would be written as: <syntaxhighlight lang="html"> <abbr title="abbreviation">abbr.</abbr> </syntaxhighlight> Informally, HTML elements are sometimes referred to as "tags" (an example of [[synecdoche]]), though many prefer the term ''tag'' strictly in reference to the markup delimiting the start and end of an element. Element (and attribute) names may be written in any combination of upper or lower case in HTML, but must be in lower case in XHTML.<ref name="XHTML10-42">[[#XHTML10|XHTML 1.0]] §4.2</ref> The canonical form was upper-case until [[HTML 4]], and was used in HTML specifications, but in recent years, lower-case has become more common. ==== Types of element ==== There are three kinds of [[HTML]] elements: normal elements, raw text elements, and void elements. '''{{vanchor|Normal elements}}''' usually have both a start tag and an end tag, although for some elements the end tag, or both tags, can be omitted. It is constructed in a similar way: * a ''start tag'' ({{tag|{{var|tag}}|o}}) marking the beginning of an element, which may incorporate any number of [[HTML attribute]]s; * some amount of ''content'', including text and other elements; * an ''end tag'', in which the element name is prefixed with a [[Slash (punctuation)|slash]]: {{tag|{{var|tag}}|c}}. '''{{vanchor|Raw text elements}}''' (also known as text or text-only elements) are constructed with: * a ''start tag'' (in the form {{tag|{{var|tag}}|o}}) marking the beginning of an element, which may incorporate any number of HTML attributes; * some amount of text ''content'', but no elements (all tags, apart from the applicable end tag, will be interpreted as content); * an ''end tag'', in which the element name is prefixed with a slash: {{tag|{{var|tag}}|c}}. In some versions of HTML, the end tag is optional for some elements. The end tag is required in [[XHTML]]. An example is the {{tag|title|o}} element, which must not contain other elements (including markup of text), only {{em|plain}} text. '''{{Anchor|Empty element}}{{vanchor|Void elements}}''' (also sometimes called empty elements, single elements or stand-alone elements) only have a start tag (in the form {{tag|{{var|tag}}|o}}), which contains any HTML attributes. They may not contain any children, such as text or other elements. For compatibility with [[XHTML]], the HTML specification{{Which|date=August 2022}} allows an optional space and slash{{Citation needed|date=August 2022}} ({{tag|{{var|tag}}|s}} is permissible). The slash is required in [[XHTML]] and other [[XML]] applications. Two common void elements are {{tag|br|s}} (for a [[Hard return|hard line-break]], such as in a poem or an address) and {{tag|hr|s}} (for a thematic break). Other such elements are often place-holders which reference external files, such as the image ({{tag|img|s}}) element. The attributes included in the element will then point to the external file in question. Another example of a void element is {{tag|link|s}}, for which the syntax is: <syntaxhighlight lang="html"> <link rel="stylesheet" href="fancy.css" type="text/css"> </syntaxhighlight> This {{tag|link|s}} element points the browser at a [[Style sheet (web development)|style sheet]] to use when presenting the HTML document to the user. In the HTML syntax attributes do not have to be quoted if they are composed only of certain characters: letters, digits, the hyphen-minus and the period. When using the XML syntax (XHTML), on the other hand, all attributes must be quoted, and a spaced trailing [[Slash (punctuation)|slash]] is required before the last angle bracket: <syntaxhighlight lang="xml"> <link rel="stylesheet" href="fancy.css" type="text/css" /> </syntaxhighlight> ==== Attributes ==== '''[[HTML attribute]]s''' define desired behavior or indicate additional element properties. Most attributes require a ''value''. In HTML, the value can be left unquoted if it does not include spaces (<code>{{var|attribute}}={{var|value}}</code>), or it can be quoted with single or double quotes (<code>{{var|attribute}}='{{var|value}}'</code> or <code>{{var|attribute}}="{{var|value}}"</code>). In [[XML]], those quotes are required. [[Boolean data type|Boolean]] attributes, on the other hand, do not require a value to be specified. An example is the <code>checked</code> for checkboxes: <syntaxhighlight lang="html"> <input type=checkbox checked> </syntaxhighlight> In the XML (and thus [[XHTML]]) syntax, though, a value is required, and the name should be repeated as the value: <syntaxhighlight lang="xml"> <input type="checkbox" checked="checked" /> </syntaxhighlight> ===Element standards=== HTML elements are defined in a series of freely available open standards issued since 1995, initially by the [[IETF]] and subsequently by the [[W3C]]. During the [[browser wars]] of the 1990s, developers of [[user agent]]s (e.g. [[web browser]]s) often developed their own elements, some of which have been adopted in later standards. Other user agents may not recognize non-standard elements, and they will be ignored, possibly causing the page to be displayed improperly. In 1998, [[XML]] (a simplified form of SGML) introduced mechanisms to allow anyone to develop their own elements and incorporate them in [[XHTML]] documents, for use with XML-aware user agents.<ref>[[#XML10|XML 1.0]] (The ability to produce additional elements is part of the ''eXtensibility'' in the acronym.)</ref> Subsequently, HTML 4.01 was rewritten in an [[XML]]-compatible form, [[#XHTML10|XHTML 1.0]] (''eXtensible HTML''). The elements in each are identical, and in most cases valid XHTML 1.0 documents will be valid or nearly valid HTML 4.01 documents. This article mainly focuses on real HTML, unless noted otherwise; however, it remains applicable to XHTML. See [[HTML#SGML-based versus XML-based HTML|HTML]] for a discussion of the minor differences between the two. ===Element status=== Since the first version of HTML, several elements have become outmoded, and are ''[[deprecated]]'' in later standards, or do not appear at all, in which case they are ''invalid'' (and will be found invalid, and perhaps not displayed, by [[XML validation|validating]] user agents).<ref name="XML10-51">[[#XML10|XML 1.0]] §5.1</ref> In [[HTML 4.01]] / [[XHTML 1.0]], the status of elements is complicated by the existence of three types of [[Document Type Definition|DTD]]: * '''Transitional''', which contain deprecated elements, but which were intended to provide a transitional period during which authors could update their practices; * '''Frameset''', which are versions of the Transitional DTDs which also allow authors to write '''frameset''' documents; * '''Strict''', which is the up-to-date (as at 1999) form of HTML. HTML5 instead provides a listing of '''obsolete''' features to go along with the '''standardized''' normative content. They are broken down into "obsolete but conforming" for which implementation instructions exist and "non-conforming" ones that should be replaced.<ref>[[#WHATWGLS|WHATWGLS]]. § 15</ref> The first Standard ([[HTML#HTML 2|HTML 2.0]]) contained four deprecated elements, one of which was invalid in [[HTML 3.2]]. All four are invalid in [[HTML 4|HTML 4.01 Transitional]], which also deprecated a further ten elements. All of these, plus two others, are invalid in [[HTML 4|HTML 4.01 Strict]]. While the frame elements are still current in the sense of being present in the Transitional and Frameset DTDs, there are no plans to preserve them in future standards, as their function has been largely replaced, and they are highly problematic for user accessibility. (Strictly speaking, the most recent ''XHTML'' standard, [[XHTML 1.1]] (2001), does not include frames at all; it is approximately equivalent to [[XHTML 1.0|XHTML 1.0 Strict]], but also includes the '''[[Ruby (annotation markup)|Ruby markup]]''' module.)<ref name="XHTML11">[[#XHTML11|XHTML 1.1]] §A</ref> A common source of confusion is the loose use of ''deprecated'' to refer to both deprecated and invalid status, and to elements that are expected to be formally deprecated in the future. ===Content vs. presentation and behavior=== Since HTML 4, HTML has increasingly focused on the separation of content (the visible text and images) from presentation (like color, font size, and layout).<ref>{{Cite web |title=HTML & CSS |url=http://www.w3.org/standards/webdesign/htmlcss |year=2013 |publisher=[[W3C]] }}</ref> This is often referred to as a [[separation of concerns]]. HTML is used to represent the structure or content of a document, its presentation remains the sole responsibility of [[CSS]] style sheets. A default [[Style sheet (web development)|style sheet]] is suggested as part of the CSS standard, giving a default rendering for HTML.<ref>{{Cite web |title=Appendix D. Default style sheet for HTML 4 |work=Cascading Style Sheets Level 2 Revision 1 (CSS 2.1) Specification |date=7 June 2011 |url=http://www.w3.org/TR/CSS2/sample.html |publisher=[[W3C]] }}</ref> Behavior (interactivity) is also kept separate from content, and is handled by [[Client-side scripting|scripts]]. Images are contained in separate [[graphics]] files, separate from text, though they can also be considered part of the content of a page. Separation of concerns allows the document to be presented by different user agents according to their purposes and abilities. For example, a user agent can select an appropriate style sheet to present a document by displaying on a monitor, printing on paper, or to determine speech characteristics in an audio-only user agent. The structural and semantic functions of the markup remain identical in each case. Historically, user agents did not always support these features. In the 1990s, as a stop-gap, presentational elements (like {{tag|b|o}} and {{tag|i|o}}) were added to HTML, at the cost of creating problems for interoperability and user accessibility. This is now regarded as outmoded and has been superseded by style sheet-based design; most presentational elements are now deprecated.<ref name="HTML401-141">[[#HTML401|HTML 4.01]] §14.1</ref> External image files are incorporated with the {{tag|img|s}} or {{tag|object|s}} elements. (With [[XHTML]], the [[Scalable Vector Graphics|SVG]] language can also be used to write graphics within the document, though linking to external SVG files is generally simpler.)<ref name="SVG11-23">{{cite web |editor-last1=Ferraiolo |editor-first1=J. |editor-last2=Fujisawa |editor-first2=J. |editor-last3=Jackson |editor-first3=D. |work=Scalable Vector Graphics (SVG) 1.1 Specification |title=§2.3 Options for using SVG in Web pages |publisher=[[W3C]] |date=2003-01-14 |url= http://www.w3.org/TR/2003/REC-SVG11-20030114/ |access-date=2009-03-25}}</ref> Where an image is not purely decorative, HTML allows replacement content with similar semantic value to be provided for non-visual user agents. An HTML document can also be extended through the use of scripts to provide additional behaviors beyond the abilities of HTML hyperlinks and forms. The elements {{tag|style|o}} and {{tag|script|o}}, with related [[HTML attributes]], provide style sheets and scripts. * In the document head, {{tag|style|s}} and {{tag|script|s}} may link to shared external documents, or {{tag|style}} and {{tag|script}} may contain embedded instructions. (The {{tag|link|o}} element can also be used to link style sheets.) * {{tag|script|s}} or {{tag|script}} can occur at any point in the document (head or body). * The <code>style</code> attribute is valid in most document body elements (e.g. {{tag|div|o|attribs=style="..."}}) for inclusion of ''inline style'' instructions. * ''Event-handling attributes'', which provide links to scripts, are optional in most elements. * For user agents which do not operate scripts, the {{tag|noscript}} element provides embedded alternative content where appropriate; however, it can only be used in the document head and in the body as a block-level element. ==Document structure elements== {{glossary}} {{term|term=html |content= {{XMLElement|html|HTML}} }} {{defn|1= The [[root element]] of an [[HTML]] document; all other elements are contained in this. The HTML element delimits the beginning and the end of an HTML document.}} {{defn|1= Both the start and end tags may be omitted (HTML5).<ref name=whatwg-syntax-tag-omission/>}} {{defn|1= '''Standardized''' in [[#HTML20|HTML 2.0]]; still current.}} {{term|term=head |content= {{XMLElement|head|Head}} }} {{defn|1= {{ghat|(See [[#Document head elements|document head elements]] for child elements.)}} Container for processing information and metadata for an HTML document. }} {{defn|1= Both the start and end tags may be omitted and inferred from child elements (HTML5).<ref name=whatwg-syntax-tag-omission/>}} {{defn|1= '''Standardized''' in [[#HTML20|HTML 5.0]]; still current.}} {{term|term=body |content= {{XMLElement|body|Body|}} }} {{defn|1= {{ghat|(See [[#Document body elements|document body elements]] for child elements.)}} Container for the displayable content of an HTML document. }} {{defn|1= Both the start and end tags may be omitted and inferred from child elements (HTML5).<ref name=whatwg-syntax-tag-omission/>}} {{defn|1= '''Standardized''' in [[#HTML20|HTML 2.0]]; still current.}} {{glossary end}} ==Document head elements== {{glossary}} {{term|term=base |content= {{XMLElement|base|Base|end=no}} }} {{defn|1= Specifies a '''base URL''' for all relative <code>href</code> and other links in the document. Must appear before any element that refers to an external resource. HTML permits only one {{tag|base|o}} element for each document. This element has [[HTML attributes]], but no contents.}} {{defn|1= A development version of this element (as <code>BASE</code>) is mentioned in ''[[#HTMLTAGS|HTML Tags]]''; '''standardized''' in [[#HTML20|HTML 2.0]]; still current.}} {{term|term=basefont |content= {{XMLElement|basefont|Base Font|deprecated=1|end=no}} }} {{defn|1= Specifies a base font size, typeface, and color for the document. Used together with {{tag|font|o}} elements. [[Deprecation|Deprecated]] in favor of [[Style sheet (web development)|style sheets]].}} {{defn|1= '''Standardized''' in [[#HTML32|HTML 3.2]]; '''deprecated''' in [[#HTML401|HTML 4.0 Transitional]]; '''invalid''' in [[#HTML401|HTML 4.0 Strict]].}} {{term|term=isindex |content= {{XMLElement|isindex|Index|...|end=no|deprecated=1}} }} {{defn|1= {{code|lang=html|code=<isindex>}} could either appear in the document head or in the body, but only once in a document. See [[Fieldset|Forms]].}} {{term|term=link |content= {{XMLElement|link|Link|end=no}} }} {{defn|1= Specifies links to other documents, such as ''previous'' and ''next'' links, or alternate versions.<ref>[[#HTML401|HTML 4.01]] §12.3</ref> A common use is to link to external [[Cascading Style Sheets|style sheets]], using the form, {{code|lang=html|code=<link rel="stylesheet" type="text/css" href="url" title="description_of_style">}}.<ref>[[#HTML401|HTML 4.01]] §14.3.2</ref> A less-common, but important, usage is to supply navigation hints consistently through use of [[microformat]]s. Several common relationships are defined, that may be exposed to users through the browser interface rather than directly in the web page, such as: {{code|lang=html|code=<link rel="next" href="url">}}. A document's {{tag|head|o}} element may contain any number of {{tag|link|s}} elements. This element has [[HTML attributes]], but no contents. }} {{defn|1= <code>LINK</code> existed in ''[[#HTMLDRAFT12|HTML Internet Draft 1.2]]'', and was '''standardized''' in [[#HTML20|HTML 2.0]]; still current.}} {{term|term=meta |content= {{XMLElement|meta|Meta|end=no}} }} {{defn|1= {{Main|Meta element}} Can be used to specify additional [[metadata]] about a document, such as its author, publication date, expiration date, language, page title, page description, keywords, or other information not provided through the other header elements and [[HTML attributes]]. Because of their generic nature, {{tag|meta|s}} elements specify associative [[Associative array|key-value pairs]]. In general, a meta element conveys hidden information about the document. Several meta tags can be used, all of which should be nested in the head element. The specific purpose of each {{tag|meta|s}} element is defined by its attributes. Outside of [[XHTML]], it is often given without the slash ({{tag|meta|o}}), despite being a [[#Void elements|void element]]. In one form, {{tag|meta|s}} elements can specify [[HTTP]] headers which should be sent by a [[web server]] before the actual content. For example, {{code|lang=html|code=<meta http-equiv="foo" content="bar" />}} specifies that the page should be served with an HTTP header called <code>foo</code> that has a value <code>bar</code>. In the general form, a {{tag|meta|s}} element specifies <code>name</code> and associated <code>content</code> HTML attributes describing aspects of the HTML page. To prevent possible ambiguity, an optional third attribute, <code>scheme</code>, may be supplied to specify a semantic framework that defines the meaning of the key and its value. For example, in {{code|lang=html|code=<meta name="foo" content="bar" scheme="DC" />}} the {{tag|meta|s}} element identifies itself as containing the <code>foo</code> element, with a value of <code>bar</code>, from the DC or [[Dublin Core]] [[Resource Description Framework|resource description framework]]. }} {{defn|1= '''Standardized''' in [[#HTML20|HTML 2.0]]; still current.}} {{term|term=object |content= {{XMLElement|object|Object}} }} {{defn|1= Used for including generic objects within the document header. Though rarely used within a {{tag|head|o}} element, it could potentially be used to extract foreign data and associate it with the current document.}} {{defn|1= '''Standardized''' in [[#HTML401|HTML 4.0]]; still current.}} {{term|term=script |content= {{XMLElement|script|Script}} }} {{defn|1= Can act as a container for script instructions or link to an external script with the optional <code>src</code> attribute.<ref>[[#HTML401|HTML 4.01]] §18</ref> Also usable in the document body to dynamically generate either both block or inline content.}} {{defn|1= '''Standardized''' in [[#HTML32|HTML 3.2]]; still current.}} {{term|term=style |content= {{XMLElement|style|Style}} }} {{defn|1= Specifies a [[Cascading Style Sheets|CSS style]] for the document, usually in the form, {{code|lang=html|code=<style type="text/css"> ... </style>}}. Can either act as a container for style instructions or link to external style sheets – for example, in [[Cascading Style Sheets|CSS]], with <code>@import</code> directives of the form,<ref>[[#CSS1|CSS]] §1.1</ref> {{code|lang=html|code=<style> @import url; </style>}} }} {{defn|1= '''Standardized''' in [[#HTML32|HTML 3.2]]; still current.}} {{term|term=title |content= {{XMLElement|title|Title}} }} {{defn|1= This tag defines a document title. Required in every [[HTML]] and [[XHTML]] document. User agents may use the title in different ways. For example: * Web browsers usually display it in a window's [[title bar]] when the window is open, and (where applicable) in the [[task bar]] when the window is minimized. * It may become the default file-name when saving the page. * We can use <title> element only one time in a web page, and when we make another page then we will use again another <title> element with new title (do not take same name for all title tag in website, It can be problem for search engines). * [[Web search engine]]s' [[web crawler]]s may pay particular attention to the words used in the title. The {{tag|title|o}} element must not contain other elements, only text. Only one {{tag|title|o}} element is permitted in a document. }} {{defn|1= Existed in ''[[#HTMLTAGS|HTML Tags]]'', and was '''standardized''' in [[#HTML20|HTML 2.0]]; still current.}} {{glossary end}} ==Document body elements== In visual browsers, displayable elements can be rendered as either ''block'' or ''inline''. While all elements are part of the document sequence, block elements appear within their parent elements: * as rectangular objects which do not break across lines; * with block margins, width, and height properties which can be set independently of the surrounding elements. Conversely, inline elements are treated as part of the flow of document text; they cannot have margins, width, or height set, and do break across lines. ===Block elements=== Block elements, or block-level elements, have a rectangular structure. By default, these elements will span the entire width of its parent element, and will thus not allow any other element to occupy the same horizontal space as it is placed on. The rectangular structure of a block element is often referred to as the [[:File: W3C and Internet Explorer box models.svg|box model]], and is made up of several parts. Each element contains the following: * The '''content''' of an element is the actual text (or other media) placed between the opening and closing tags of an element. * The '''padding''' of an element is the space around the content but which still forms part of the element. Padding should not be used to create white space between two elements. Any background style assigned to the element, such as a background image or color, will be visible within the padding. Increasing the size of an element's padding increases the amount of space this element will take up. * The '''border''' of an element is the absolute end of an element and spans the perimeter of that element. The thickness of a border increases the size of an element. * The '''margin''' of an element is the white space that surrounds an element. The content, padding, and border of any other element will not be allowed to enter this area unless forced to do so by some advanced [[CSS]] placement. Using most standard [[Document Type Definition|DTDs]], margins on the left and right of different elements will push each other away. Margins on the top or bottom of an element, on the other hand, will not stack or will intermingle. This means that the white space between these elements will be as big as the larger margin between them. The above section refers only to the detailed implementation of CSS rendering and has no relevance to HTML elements themselves. ====Basic text==== {{glossary}} {{term|term=p |content= {{XMLElement|p|Paragraph}} }} {{defn|1= Creates a paragraph, perhaps the most common block level element.}} {{defn|<code>P</code> existed in ''[[#HTMLTAGS|HTML Tags]]'', and was '''standardized''' in [[#HTML20|HTML 2.0]]; still current.}} {{term|term=h1 |content= {{XMLElement|h1|Level 1 heading}} {{anchor|heading}} }} {{term|term=h2 |content= {{XMLElement|h2|Level 2 heading}} |multi=y}} {{term|term=h3 |content= {{XMLElement|h3|Level 3 heading}} |multi=y}} {{term|term=h4 |content= {{XMLElement|h4|Level 4 heading}} |multi=y}} {{term|term=h5 |content= {{XMLElement|h5|Level 5 heading}} |multi=y}} {{term|term=h6 |content= {{XMLElement|h6|Level 6 heading}} |multi=y}} {{defn|1= Section headings at different levels. <code>h1</code> delimits the highest-level heading, <code>h2</code> the next level down (sub-section), <code>h3</code> for a level below that, and so on to <code>h6</code>. They are sometimes referred to collectively as <code>h''n''</code> tags, ''n'' meaning any of the available heading levels. Most visual browsers show headings as large bold text by default, though this can be overridden with [[Cascading Style Sheets|CSS]]. Heading elements are not intended merely for creating large or bold text – in fact, they should {{em|not}} be used for explicitly styling text. Rather, they describe the document's structure and organization. Some programs use them to generate outlines and tables of contents. }} {{defn|Headings existed in ''[[#HTMLTAGS|HTML Tags]]'', and were '''standardized''' in [[#HTML20|HTML 2.0]]; still current.}} {{glossary end}} ==== Lists ==== {{glossary}} {{anchor|dl}}{{term|term=dl |content= {{XMLElement|dl|Definition List}} }} {{defn|1= {{redirect|Definition list|Wikipedia's article on lists of definitions|Glossary}} A description list (a.k.a. [[association list]] or definition list) consists of name–value groups,<ref name="W3C-5-DL">{{cite web |url=http://www.w3.org/TR/html5/grouping-content.html#the-dl-element |title=4.4 Grouping content – HTML5 |work=HTML5: A vocabulary and associated APIs for HTML and XHTML – W3C Recommendation |publisher=[[World Wide Web Consortium]] |at=§4.4.8 The dl element |date=28 October 2014 |access-date=16 August 2015}}</ref> and was known as a definition list prior to HTML5.<ref>{{cite web |url=http://www.w3.org/TR/html4/struct/lists.html#edef-DL |title=Lists in HTML documents |at=§10.3 Definition lists: the DL, DT, and DD elements |work=HTML 4.01 Specification – W3C Recommendation |date=24 December 1999 |publisher=World Wide Web Consortium |access-date=2 May 2015 }}</ref> Description lists are intended for groups of "terms and definitions, metadata topics and values, questions and answers, or any other groups of name–value data".<ref>{{cite web |website=[[W3C]]|title=HTML5: A Vocabulary and Associated APIs for HTML and XHTML, W3C Working Draft|date=5 April 2011|url=http://www.w3.org/TR/2011/WD-html5-20110405/grouping-content.html#the-dl-element}}.</ref> }} {{defn|<code>DL</code> existed in ''[[#HTMLTAGS|HTML Tags]]'', and was '''standardized''' in [[#HTML20|HTML 2.0]]; still current.}} {{term|term=dt |content= {{XMLElement|dt|Definition Term}} }} {{defn|1= A name in a description list (previously definition term in a definition list).}} {{defn|<code>DT</code> existed in ''[[#HTMLTAGS|HTML Tags]]'', and was '''standardized''' in [[#HTML20|HTML 2.0]]; still current.}} {{term|term=dd |content= {{XMLElement|dd|Definition}} }} {{defn|1= A value in a description list (previously definition data in a definition list).}} {{defn|<code>DD</code> existed in ''[[#HTMLTAGS|HTML Tags]]'', and was '''standardized''' in [[#HTML20|HTML 2.0]]; still current.}} {{term|term=ol |content= {{XMLElement|ol|Ordered List}} }} {{defn|1= An ordered (enumerated) list. The <code>type</code> attribute can be used to specify the kind of marker to use in the list, but style sheets give more control. The default is Arabic numbering. In an HTML attribute: {{nobr|{{code|lang=html|code=<ol type="foo">}}}}; or in a CSS declaration: {{nobr|{{code|lang=css|code=ol { list-style-type: foo; } }}}} – replacing <code><var>foo</var></code> with one of the following: * A, B, C ... – HTML value: <code>A</code>; CSS value: <code>upper-alpha</code> * a, b, c ... – HTML value: <code>a</code>; CSS value: <code>lower-alpha</code> * I, II, III ... – HTML value: <code>I</code>; CSS value: <code>upper-roman</code> * i, ii, iii ... – HTML value: <code>i</code>; CSS value: <code>lower-roman</code> * 1, 2, 3 ... – HTML value: <code>1</code>; <code>decimal</code> CSS provides several other options not available as pure-HTML markup, including <code>none</code>, and options for [[CJK]], Hebrew, Georgian, and Armenian script. The attribute is deprecated in HTML 3.2 and 4.01, but not in HTML 5. }} {{defn|<code>OL</code> existed in ''[[#HTMLDRAFT12|HTML Internet Draft 1.2]]'', and was '''standardized''' in [[#HTML20|HTML 2.0]]; still current.}} {{term|term=ul |content= {{XMLElement|ul|Unordered List}} }} {{defn|1= An unordered (bulleted) list. The type of list item marker can be specified in an HTML attribute: {{nobr|{{code|lang=html|code=<ul type="foo">}}}}; or in a CSS declaration: {{nobr|{{code|lang=css|code=ul { list-style-type: foo; } }}}} – replacing <code><var>foo</var></code> with one of the following (the same values are used in HTML and CSS): <code>disc</code> (the default), <code>square</code>, or <code>circle</code>. '''Only''' the CSS method is supported in HTML5; the attribute is deprecated in HTML 3.2 and 4.01. CSS also provides <code>none</code>, and the ability to replace these bullets with custom images.}} {{defn|<code>UL</code> existed in ''[[#HTMLTAGS|HTML Tags]]'', and was '''standardized''' in [[#HTML20|HTML 2.0]]; still current.}} {{term|term=li |content= {{XMLElement|li|List Item}} }} {{defn|1= A list item in ordered (<code>ol</code>) or unordered (<code>ul</code>) lists.}} {{defn|<code>LI</code> existed in ''[[#HTMLTAGS|HTML Tags]]'', and was '''standardized''' in [[#HTML20|HTML 2.0]]; still current.}} {{term|term=dir |content= {{XMLElement|dir|Directory List|deprecated=1}} }} {{defn|1= A directory listing. The original purpose of this element was never widely supported; deprecated in favor of {{code|lang=html|code=<ul>}}.}} {{defn|<code>DIR</code> existed in ''[[#HTMLTAGS|HTML Tags]]'', and was '''standardized''' in [[#HTML20|HTML 2.0]]; '''deprecated''' in [[#HTML401|HTML 4.0 Transitional]]; '''invalid''' in [[#HTML401|HTML 4.0 Strict]].}} {{glossary end}} ==== Other block elements ==== <!--linked from Template:Pre2--> {{glossary}} {{term|term=address |content= {{XMLElement|address|Address}} }} {{defn|1= Contact information for the document author.}} {{defn|<code>ADDRESS</code> existed in ''[[#HTMLTAGS|HTML Tags]]'', and was '''standardized''' in [[#HTML20|HTML 2.0]]; still current.}} {{term|term=article |content= {{XMLElement|article|Article}} }} {{defn|1= {{Main|Article element}} Used for articles and other similar content. }} {{defn|'''Standardized''' in [[#HTML5|HTML5]].}} {{term|term=aside |content= {{XMLElement|aside|Aside}} }} {{defn|1= Used for content in a document which is separate from the main page content, for example, sidebars or advertising.}} {{defn|'''Standardized''' in [[#HTML5|HTML5]].}} {{term|term=blockquote |content= {{XMLElement|blockquote|BlockQuotation}}<!-- Linked from [[Wikipedia:Quotations]] --> }} {{defn|1= {{Main|Blockquote element}} A [[blockquote|block level quotation]], for when the quotation includes block level elements, e.g. paragraphs. The <code>cite</code> attribute (not to be confused with the [[#cite|{{tag|cite|o}}]] element) may give the source, and must be a fully qualified [[Uniform Resource Identifier]]. The default presentation of block quotations in visual browsers is usually to indent them from both margins. This has led to the element being unnecessarily used just to indent paragraphs, regardless of semantics. For quotations not containing block level elements see the quote ([[#q|{{tag|q|o}}]]) element. }} {{defn|<code>BLOCKQUOTE</code> existed in ''[[#HTMLDRAFT12|HTML Internet Draft 1.2]]'', and was '''standardized''' in [[#HTML20|HTML 2.0]]; still current. See [[blockquote element]] for more information.}} {{term|term=center |content= {{XMLElement|center|Centered Text|deprecated=1}} }} {{defn|1= Creates a block-level center-aligned division. Deprecated in favor of [[#div|{{tag|div|o}}]] or another element with centering defined using style sheets.}} {{defn|'''Standardized''' in [[#HTML32|HTML 3.2]]; '''deprecated''' in [[#HTML401|HTML 4.0]]; '''not supported''' in [[#HTML5|HTML5]].}} {{term|term=del |content= {{XMLElement|del|Deleted Section}} }} {{defn|1= Marks a deleted section of content. This element can also be used as ''inline''.}} {{defn|'''Standardized''' in [[#HTML401|HTML 4.0]]; still current.}} {{term|term=div |content= {{XMLElement|div|Logical division}} }} {{defn|1= {{Main|Span and div}} A block-level logical division. A generic element with no semantic meaning used to distinguish a document section, usually for purposes such as presentation or behavior controlled by [[Cascading Style Sheets|style sheets]] or [[Document Object Model|DOM]] calls.}} {{defn|Proposed in the [[#HTML30|HTML 3.0 Drafts]]; '''Standardized''' in [[#HTML32|HTML 3.2]]; still current.}} {{term|term=figure |content= {{XMLElement|figure|Figure}} }} {{defn|1= Used to group images and captions, along with {{tag|figcaption|o}}.}} {{defn|'''Standardized''' in [[#HTML5|HTML5]].}} {{term|term=figcaption |content= {{XMLElement|figcaption|Figure Caption}} }} {{defn|1= A caption for an image. Always placed inside the {{tag|figure|o}} element.}} {{defn|'''Standardized''' in [[#HTML5|HTML5]].}} {{term|term=footer |content= {{XMLElement|footer|Footer}} }} {{defn|1= Used for document footers. These might contain author or copyright information, or links to other pages.}} {{defn|'''Standardized''' in [[#HTML5|HTML5]].}} {{term|term=header |content= {{XMLElement|header|Header}} }} {{defn|1= Used for document headers. These typically contain content introducing the page.}} {{defn|'''Standardized''' in [[#HTML5|HTML5]].}} {{term|term=hr |content= {{XMLElement|hr|Thematic break|end=no}} }} {{defn|1= A [[thematic break (formatting)|thematic break]] (originally: horizontal rule). Presentational rules can be drawn with style sheets.}} {{defn|'''Standardized''' in [[#HTML20|HTML 2.0]]; still current.}} {{term|term=ins |content= {{XMLElement|ins|Inserted Section}} }} {{defn|1= Marks a section of inserted content. This element can also be used as ''inline''.}} {{defn|'''Standardized''' in [[#HTML401|HTML 4.0]]; still current.}} {{term|term=main |content= {{XMLElement|main|Main Content}} }} {{defn|1= Contains the main content of a document.}} {{defn|'''Standardized''' in [[#HTML5|HTML 5.1]].}} {{term|term=menu |content= {{XMLElement|menu|Menu}} }} {{defn|1= HTML 2.0: A menu listing. Should be more compact than a {{tag|ul|o}} list.}} {{defn|<code>MENU</code> existed in ''[[#HTMLTAGS|HTML Tags]]'', and was '''standardized''' in [[#HTML20|HTML 2.0]]; '''deprecated''' in [[#HTML401|HTML 4.0 Transitional]]; '''invalid''' in [[#HTML401|HTML 4.0 Strict]]; then redefined in [[#HTML5|HTML5]], removed in HTML 5.2, but is included in the HTML Living Standard in 2019. }} {{term|term=nav |content= {{XMLElement|nav|Navigation}} }} {{defn|1= Used in navigational sections of articles (areas of webpages which contain links to other webpages).}} {{defn|'''Standardized''' in [[#HTML5|HTML5]].}} {{term|term=noscript |content= {{XMLElement|noscript|JavaScript Fallback}} }} {{defn|1= Replacement content for scripts. Unlike '''script''' this can only be used as a block-level element.}} {{defn|'''Standardized''' in [[#HTML401|HTML 4.0]]; still current.}} {{term|term=pre |content= {{XMLElement|pre|PreFormatted Text}} }} {{defn|1= ''Pre-formatted'' text. Text within this element is typically displayed in a [[non-proportional font]] exactly as it is laid out in the file (see [[ASCII art]]). Whereas browsers ignore [[Whitespace (computer science)|white-space]] for other HTML elements, in {{tag|pre}}, white-space should be rendered as authored. (With the CSS properties: {{code|lang=css|code={ white-space: pre; font-family: monospace; }<nowiki />}}, other elements can be presented in the same way.) This element can contain any inline element except: [[#image|{{tag|image|o}}]], [[#object|{{tag|object|o}}]], [[#big|{{tag|big|o}}]], [[#small|{{tag|small|o}}]], [[#sup|{{tag|sup|o}}]], and [[#sub|{{tag|sub}}]].}} {{defn|<code>PRE</code> existed in ''[[#HTMLDRAFT12|HTML Internet Draft 1.2]]'', and was '''standardized''' in [[#HTML20|HTML 2.0]]; still current.}} {{term|term=section |content= {{XMLElement|section|Section}} }} {{defn|1= Used for generic sections of a document. This is different from [[#div|{{tag|div|o}}]] in that it is only used to contain sections of a page, which the W3C defines as a group of content with a similar theme.}} {{defn|'''Standardized''' in [[#HTML5|HTML5]].}} {{term|term=script |content= {{XMLElement|script|Script}} }} {{defn|1= Places a script in the document. Also usable in the head and in inline contexts. It may be used as {{tag|script|s}} with a <code>src</code> attribute to supply a URL from which to load the script, or used as {{tag|script}} around embedded script content. {{strong|Note:}} {{tag|script|o}} is not itself either a block or inline element; by itself it should not display at all, but it can contain instructions to dynamically generate either both block or inline content.}} {{defn|'''Standardized''' in [[#HTML32|HTML 3.2]]; still current.}} {{glossary end}} ===Inline elements=== Inline elements cannot be placed directly inside the {{code|lang=html|code=<body>}} element; they must be wholly nested within block-level elements.<ref>{{citation|url=http://www.w3.org/TR/html401/struct/global.html#h-7.5.1 |title=HTML 4.01 |publisher=W3C |access-date=2012-03-26}}</ref> ====Anchor==== {{for|anchors on Wikipedia|WP:ANCHOR DEF|selfref=true}} {{glossary}} {{term|term=a |content= {{XMLElement|a|Anchor}} }} {{defn|1= <p>An anchor element is called an anchor because web designers can use it to "anchor" a URL to some text on a web page. When users view the web page in a browser, they can click the text to activate the link and visit the page whose URL is in the link.<ref>{{cite book |last1= Tittel |first1= Ed |last2= Burmeister |first2= Mary C. |date= 2005 |title= HTML 4 for dummies |edition= 5th |publisher= Wiley |location= Hoboken, New Jersey |isbn= 978-0-7645-8917-1 |page= 96 |url= https://archive.org/details/html4fordummies00titt_2/page/96/ |url-access= registration |access-date= 7 August 2022}}</ref></p> <p>In HTML, an "anchor" can be either the {{em|origin}} (the [[anchor text]]) or the {{em|target}} (destination) end of a [[hyperlink]]. As an origin, setting the attribute <code>href</code>,<ref>{{cite web|url=http://www.w3.org/Provider/ServerWriter.html|title=ServerWriter -- /Provider|website=W3C}}</ref> creates a hyperlink; it can point to either another part of the document or another resource (e.g. a webpage) using an external [[Uniform Resource Locator|URL]]. As a target, setting the <code>name</code> or <code>id</code> [[HTML attributes]], allows the element to be linked from a [[Uniform Resource Locator]] (URL) via a [[fragment identifier]]. The two forms, origin and anchor, can be used concurrently.</p> In HTML5, any element can now be made into a target by using the <code>id</code> attribute,<ref>{{cite web|url=http://www.w3.org/tr/html5/index.html#attributes-1|title=HTML 5.2|website=W3C}}</ref> so using {{code|lang=html|code=<a name="foo">...</a>}} is not necessary, although this way of adding anchors continues to work.</p> <p>To illustrate: the header of a table of contents section on <samp>example.com</samp>'s homepage could be turned into a target by writing: {{code|lang=html|code=<h2><a name="contents">Table of contents</a></h2>}}.</p> <p>Continuing with this example, now that the section has been marked up as a target, it can be referred to from external sites with a link like: {{code|lang=html|code=<a href="http://example.com#contents">see contents</a>}};</p> <p>or with a link on the same page like: {{code|lang=html|code=<a href="#contents">contents, above</a>}}.</p> <p>The attribute <code>title</code> may be set to give brief information about the link: {{code|lang=html|code=<a href="URL" title="additional information">link text</a>}}.</p> <p>In most graphical browsers, when the cursor hovers over a link, the cursor changes into a hand with an extended index finger and the <code>title</code> value is displayed in a [[tooltip]] or in some other manner. Some browsers render [[Alt attribute|alt text]] the same way, although this is not what the specification calls for.</p> }} {{defn|<code>A</code> existed in ''[[#HTMLTAGS|HTML Tags]]'', and was '''standardized''' in [[#HTML20|HTML 2.0]];}} {{glossary end}} ====Phrase elements==== Phrase elements are used for marking up phrases and adding structure or semantic meaning to text fragments. For example, the {{tag|em|o}} and {{tag|strong|o}} tags can be used for adding emphasis to text. =====General===== {{glossary}} {{term|term=abbr |content= {{XMLElement|abbr|Abbreviation}} }} {{defn|1= Marks an [[abbreviation]], and can make the full form available: {{code|lang=html|code=<abbr title="abbreviation">abbr.</abbr>}}}} {{defn|'''Standardized''' in [[#HTML401|HTML 4.0]]; still current.}} {{term|term=acronym |content= {{XMLElement|acronym|Acronym|deprecated=1}} }} {{defn|1= Similar to the {{code|lang=html|code=<abbr>}} element, but marks an [[acronym]]: {{code|lang=html|code=<acronym title="Hyper-Text Mark-up Language">HTML</acronym>}}}} {{defn|'''Standardized''' in [[#HTML401|HTML 4.0]]; still current, '''not supported''' in [[#HTML5|HTML5]]. Recommended replacement is the <code>abbr</code> tag.<ref>[https://www.w3schools.com/tags/tag_acronym.asp Acronym tag], acronym.</ref>}} {{term|term=dfn |content= {{XMLElement|dfn|Definition}} }} {{defn|1= Inline definition of a single term.}} {{defn|<code>DFN</code> existed in ''[[#HTMLDRAFT12|HTML Internet Draft 1.2]]'', and was fully '''standardized''' in [[#HTML32|HTML 3.2]]; still current.}} {{term|term=em |content= {{XMLElement|em|Emphasis}} }} {{defn|1= <em>Emphasis</em> (conventionally displayed in italics)}} {{defn|<code>EM</code> existed in ''[[#HTMLDRAFT12|HTML Internet Draft 1.2]]'', and was '''standardized''' in [[#HTML20|HTML 2.0]]; still current.}} {{term|term=strong |content= {{XMLElement|strong|Importance}} }} {{defn|1= <strong>importance</strong>; originally strong emphasis (conventionally displayed bold). An [[voice browser|aural user agent]] may use different voices for emphasis. }} {{defn|<code>STRONG</code> existed in ''[[#HTMLDRAFT12|HTML Internet Draft 1.2]]'', and was '''standardized''' in [[#HTML20|HTML 2.0]]; still current, redefined in HTML5.}} {{glossary end}} =====Computer phrase elements===== These elements are useful primarily for documenting computer code development and user interaction through differentiation of source code ({{code|lang=html|code=<code>}}), variables ({{code|lang=html|code=<var>}}), user input ({{code|lang=html|code=<kbd>}}), and terminal or other output ({{code|lang=html|code=<samp>}}). {{glossary}} {{term|term=code |content= {{XMLElement|code|Sourcecode}} }} {{defn|1= A code snippet (<code>code example</code>). Conventionally rendered in a mono-space font.}} {{defn|<code>CODE</code> existed in ''[[#HTMLDRAFT12|HTML Internet Draft 1.2]]'', and was '''standardized''' in [[#HTML20|HTML 2.0]]; still current.}} {{term|term=kbd |content= {{XMLElement|kbd|Keyboard}} }} {{defn|1= Keyboard – text to be entered by the user (<kbd>kbd example</kbd>).}} {{defn|<code>KBD</code> existed in ''[[#HTMLDRAFT12|HTML Internet Draft 1.2]]'', and was '''standardized''' in [[#HTML20|HTML 2.0]]; still current.}} {{term|term=samp |content= {{XMLElement|samp|Sample}} }} {{defn|1= Sample output – from a program or script: (<samp>samp example</samp>).}} {{defn|<code>SAMP</code> existed in ''[[#HTMLDRAFT12|HTML Internet Draft 1.2]]'', and was '''standardized''' in [[#HTML20|HTML 2.0]]; still current.}} {{term|term=var |content= {{XMLElement|var|Variable}} }} {{defn|1= Variable (<var>var example</var>).}} {{defn|<code>VAR</code> existed in ''[[#HTMLDRAFT12|HTML Internet Draft 1.2]]'', and was '''standardized''' in [[#HTML20|HTML 2.0]]; still current.}} {{glossary end}} ====Presentation==== As visual presentational markup only applies directly to visual browsers, its use is discouraged. Style sheets should be used instead. Several of these elements are deprecated or invalid in HTML 4 / XHTML 1.0, and the remainder are invalid in the current draft of [http://www.w3.org/TR/2005/WD-xhtml2-20050527/ XHTML 2.0]. The current draft of [https://web.archive.org/web/20150801133040/http://www.w3.org/TR/html5/text-level-semantics.html HTML5], however, re-includes {{tag|s|o}}, {{tag|u|o}}, and {{tag|small|o}}, assigning new semantic meaning to each. In an [[HTML5]] document, the use of these elements is no longer discouraged, provided that it is semantically correct. {{term|term=b |content= {{XMLElement|b|Keyword}} }} {{defn|1= <!-- not deprecated in [[HTML 4.01]]; not included in [[XHTML 2.0]] which is in draft stage; now a semantic element in [[HTML5]] --> In [[HTML 4]], set font to '''boldface''' where possible. Equivalent CSS: {{code|lang=css|code={ font-weight: bold; } }}. The {{tag|strong|o}} element usually has the same effect in visual browsers, as well as having more semantic meaning, under [[HTML 4.01]]. In [[HTML5]], however, {{tag|b|o}} has its own meaning, distinct from that of {{tag|strong|o}}. It denotes "text to which attention is being drawn for utilitarian purposes without conveying any extra importance and with no implication of an alternate voice or mood."<ref name="html5-b-element">{{citation|url=http://developers.whatwg.org/text-level-semantics.html#the-b-element |title=4.6 Text-level semantics — The b element |publisher=Developers.whatwg.org |access-date=2012-03-26}}</ref> }} {{defn|<code>B</code> existed in ''[[#HTMLDRAFT12|HTML Internet Draft 1.2]]'', and was '''standardized''' in [[#HTML20|HTML 2.0]]; still current, redefined in HTML5.}} {{term|term=i |content= {{XMLElement|i|Alternate voice}} }} {{defn|1= <!-- not deprecated in HTML 4.01; not included in XHTML 2.0 which is in draft stage; now a semantic element in HTML5 --> In [[HTML 4]], set font to ''italic'' where possible. Equivalent [[CSS]]: {{code|lang=css|code={ font-style: italic; } }}. Using {{tag|em}} has the same visual effect in most browsers, as well as having a semantic meaning as ''emphasis'', under [[HTML 4.01]]. (Purely typographic italics have many non-emphasis purposes, as HTML 5 more explicitly recognized.) In [[HTML5]], however, {{tag|i|o}} has its own semantic meaning, distinct from that of {{tag|em|o}}. It denotes "a different quality of text" or "an alternate<!--sic--> voice or mood" e.g., a thought, a ship name, a [[Binomial nomenclature|binary species name]], a foreign-language phrase, etc.<!-- Not (or no longer) a precise quote, so don't put this in quotation marks --><ref name="html5-i-element">{{citation|url=http://developers.whatwg.org/text-level-semantics.html#the-i-element |title=4.6 Text-level semantics — The i element |publisher=Developers.whatwg.org |access-date=2012-03-26}}</ref> }} {{defn|<code>I</code> existed in ''[[#HTMLDRAFT12|HTML Internet Draft 1.2]]'', and was '''standardized''' in [[#HTML20|HTML 2.0]]; still current, redefined in HTML5.}} {{term|term=u |content= {{XMLElement|u|Unarticulated annotation}} }} {{defn|1= In [[HTML 4]], <u>underlined</u> text. Equivalent CSS: {{code|lang=css|code={ text-decoration: underline; } }}. Deprecated in [[HTML 4.01]]. Restored in [[#HTML5|HTML5]]. In [[HTML5]], the {{tag|u|o}} element denotes "a span of text with an unarticulated, though explicitly rendered, non-textual annotation, such as labelling the text as being a proper name in Chinese text (a Chinese proper name mark), or labelling the text as being misspelt." The [[HTML5]] specification reminds developers that other elements are almost always more appropriate than {{tag|u|o}} and admonishes designers not to use underlined text where it could be confused for a hyper-link.<ref name="html5-u-element">{{citation|url=http://developers.whatwg.org/text-level-semantics.html#the-u-element |title=4.6 Text-level semantics — The u element |publisher=Developers.whatwg.org |access-date=2012-03-26}}</ref> }} {{defn|<code>U</code> existed in ''[[#HTMLDRAFT12|HTML Internet Draft 1.2]]'', was '''standardized''' in [[#HTML32|HTML 3.2]] but was '''deprecated''' in [[#HTML401|HTML 4.0 Transitional]] and was '''invalid''' in [[#HTML401|HTML 4.0 Strict]]. '''Reintroduced''' in [[#HTML5|HTML5]].}} {{term|term=small |content= {{XMLElement|small|Side comment}} }} {{defn|1= In [[HTML 4]], decreased font size (<small>smaller</small> text). Equivalent CSS: {{code|lang=css|code={ font-size: smaller; } }} In [[HTML5]], the {{tag|small|o}} element denotes "side comments such as small print."<ref name="html5-small-element">{{citation|url=http://developers.whatwg.org/text-level-semantics.html#the-small-element |title=4.6 Text-level semantics — The small element |publisher=Developers.whatwg.org |access-date=2012-03-26}}</ref> This has caused some confusion with the {{tag|[[#aside|aside]]}} element. }} {{defn|'''Standardized''' in [[#HTML32|HTML 3.2]]; still current.}} {{term|term=s |content= {{XMLElement|s|Inacurrate text}} }} {{defn|1= In [[HTML 4]], indicated strike-through text (<s>Strikethrough</s>) and was equivalent to {{tag|strike|o}}. In [[HTML5]], the {{tag|s|o}} element denotes information that is "no longer accurate or no longer relevant", and is not to be confused with {{tag|del|o}}, which indicates removal/deletion.<ref name="html5-s-element">{{citation|url=http://developers.whatwg.org/text-level-semantics.html#the-s-element |title=4.6 Text-level semantics — The s element |publisher=Developers.whatwg.org |access-date=2012-03-26}}</ref> }} {{defn|<code>S</code> was '''deprecated''' in [[#HTML401|HTML 4.0 Transitional]] (having not appeared in any previous standard), and was '''invalid''' in [[#HTML401|HTML 4.0 Strict]]. '''Reintroduced''' in [[#HTML5|HTML5]], which instead deprecated {{tag|strike|o}}.}} {{term|term=big |content= {{XMLElement|big|Big|deprecated=1}} }} {{defn|1= Increased font size (<big>bigger</big> text). Equivalent CSS: {{code|lang=css|code={ font-size: larger; } }}}} {{defn|'''Standardized''' in [[#HTML32|HTML 3.2]]; '''not supported''' in [[#HTML5|HTML5]].}} {{term|term=strike |content= {{XMLElement|strike|Strikethrough|deprecated=1}} }} {{defn|1= Strike-through text (<s>Strikethrough</s>), (Equivalent CSS: {{code|lang=css|code={ text-decoration: line-through; } }})}} {{defn|<code>STRIKE</code> was standardized in [[#HTML32|HTML 3.2]]; '''deprecated''' in [[#HTML401|HTML 4.0 Transitional]]; '''invalid''' in [[#HTML401|HTML 4.0 Strict]].}} {{term|term=tt |content= {{XMLElement|tt|Teletype|deprecated=1}} }} {{defn|1= [[non-proportional font|Fixed-width]] font ({{mono|typewriter-like}}<!-- DO NOT use actual deprecated markup in this page; use CSS to simulate its output.-->), also known as [[Teleprinter|teletype]], thus "tt". (Equivalent CSS: {{code|lang=css|code={ font-family: monospace; } }})}} {{defn|<code>TT</code> existed in ''[[#HTMLDRAFT12|HTML Internet Draft 1.2]]'', and was '''Standardized''' in [[#HTML20|HTML 2.0]]; not supported<ref name="html5-tt-not-supported">{{citation|url=http://www.w3.org/TR/html5/obsolete.html#non-conforming-features |title=11 Obsolete features — HTML5 |publisher=W3C |access-date=2012-03-26}}</ref> in HTML5. Possible replacements: [[#kbd|{{tag|kbd|o}}]] for marking user input, [[#var|{{tag|var|o}}]] for variables (usually rendered italic, and not with a change to monospace), [[#code|{{tag|code|o}}]] for source code, [[#samp|{{tag|samp|o}}]] for output.<ref name="html5-tt-not-supported" />}} {{term|term=font |content= {{XMLElement|font|Font|deprecated=1}} }} {{defn|1= {{code|lang=html|code=<font [color=<var>color</var>] [size=<var>size</var>] [face=<var>face</var>]>...</font>}} Can specify the font color with the <code>color</code> attribute (note the American spelling), typeface with the <code>face</code> attribute, and absolute or relative size with the <code>size</code> attribute. Examples (all uses are deprecated, use CSS equivalents if possible): * {{code|lang=html|code=<font color="green">text</font>}} creates {{green|green text}}. * {{code|lang=html|code=<font color="#114499">text</font>}} creates <span style="color:#149;">text with [[Hex triplet|hexadecimal color]] #114499</span>. * {{code|lang=html|code=<font size="4">text</font>}} creates <span style="font-size:140%;">text</span> with size 4. Sizes are from 1 to 7. The standard size is 3, unless otherwise specified in the <body> or other tags. * {{code|lang=html|code=<font size="+1">text</font>}} creates <span style="font-size:125%;">text with size 1 bigger than the standard.</span> {{code|lang=html|code=<font size="-1">text</font>}} is opposite. * {{code|lang=html|code=<font face="Courier">text</font>}} makes <span style="font-family:Courier;">text</span> with Courier font. Equivalent CSS for font attributes: *<code class="mw-highlight"><span class="p"><</span><span class="nt">font</span> <span class="na">size</span><span class="o">=</span><span class="s">"<var>N</var>"</span><span class="p">></span></code> corresponds to <code class="mw-highlight"><span class="p">{</span><span class="nb">font-size</span><span class="o" style="color: #666;">:</span> <span class="nb"><var>Y</var><var>units</var></span><span class="p">}</span></code> (the HTML specification does not define the relationship between size <var>N</var> and unit-size <var>Y</var>, nor does it define a unit). *{{code|lang=html|code=<font color="red">}} corresponds to {{code|lang=css|code={ color: red; } }} *{{code|lang=html|code=<font face="Times New Roman">}} corresponds to {{code|lang=css|code={ font-family: 'Times New Roman', Times, serif; } }} – CSS supports a [[font stack]], of two or more alternative fonts. }} {{defn|'''Standardized''' in [[#HTML32|HTML 3.2]]; '''deprecated''' in [[#HTML401|HTML 4.0 Transitional]]; '''invalid''' in [[#HTML401|HTML 4.0 Strict]]. Not part of HTML5.}} ====Span==== {{glossary}} {{term|term=span |content= {{XMLElement|span|Span}} }} {{defn|1= {{Main|Span and div}} An inline logical division. A generic element with no semantic meaning used to distinguish a document section, usually for purposes such as presentation or behavior controlled by [[Cascading Style Sheets|style sheets]] or [[Document Object Model|DOM]] calls. }} {{defn|'''Standardized''' in [[#HTML401|HTML 4.0]]; still current.}} {{glossary end}} ====Other inline elements==== {{glossary}} {{term|term=br |content= {{XMLElement|br|Line Break|end=no}} }} {{defn|1= A forced line break.}} {{defn|'''Standardized''' in [[#HTML20|HTML 2.0]]; still current.}} {{term|term=bdi |content= {{XMLElement|bdi|Bidirectional Isolation}} }} {{defn|1= Isolates an inline section of text that may be formatted in a different direction from other text outside of it, such as user-generated content with unknown directionality.}} {{defn|'''Standardized''' in [[#HTML5|HTML5]].}} {{term|term=bdo |content= {{XMLElement|bdo|Bidirectional Override}} }} {{defn|1= Marks an inline section of text in which the reading direction is the opposite from that of the parent element.}} {{defn|'''Standardized''' in [[#HTML401|HTML 4.0]]; still current.}} {{term|term=cite |content= {{XMLElement|cite|Citation}} }} {{defn|1= A citation or a reference for a quote or statement in the document.}} {{defn|CITE existed in ''[[#HTMLDRAFT12|HTML Internet Draft 1.2]]'', and was '''standardized''' in [[#HTML20|HTML 2.0]]; still current.}} {{defn|''Note:'' The HTML 5 specifications have been confusingly [[Fork (software development)|forked]],<ref name=finalars>{{cite web |url= https://arstechnica.com/information-technology/2014/10/html5-specification-finalized-squabbling-over-who-writes-the-specs-continues/ |title=HTML5 specification finalized, squabbling over specs continues |publisher=Ars Technica |date=29 October 2014 |access-date=29 October 2014}}</ref> including with regard to this element. In HTML 4 and earlier, {{tag|cite|o}} was for "a citation or a reference to other sources" without any particular limitations or requirements.<ref>{{cite web |title=9.2.1 Phrase elements: EM, STRONG, DFN, CODE, SAMP, KBD, VAR, CITE, ABBR, and ACRONYM |work=HTML 4.01 Specification |date=24 December 1999 |publisher=[[W3C]] |url= https://www.w3.org/TR/html401/struct/text.html#h-9.2.1 |access-date=26 July 2018}}</ref> The [[W3C]] HTML 5 spec uses a refinement of this idea, reflecting how the element has historically been used, but now requiring that it contain (but not be limited to) at least one of "the title of the work or the name of the author (person, people or organization) or an URL reference, or a reference in abbreviated form as per the conventions used for the addition of citation metadata."<ref>[[#HTML52|''HTML 5.2 W3C Recommendation'']], at [https://www.w3.org/TR/html52/textlevel-semantics.html#the-cite-element "§4.5.6. The cite element"].</ref> But the WHATWG spec only permits the element to be used around the title of a work.<ref>[[#WHATWGLS|''HTML Living Standard'']], at [https://html.spec.whatwg.org/multipage/text-level-semantics.html#the-cite-element "§4.5.6 The cite element"].</ref> The W3C specs began with the broader definition, then switched to the very narrow one after WHATWG made this change. However, W3C reverted their own change in 2012, in response to negative developer-community feedback; the element was in broadly-deployed use with the broader scope, e.g., various blog and forum platforms wrap commenters' IDs and e-mail addresses in {{tag|cite}}, and people using the element for bibliographic citations were (and still are) routinely wrapping each entire citation in this element. Another problem with the element is that WHATWG recommends that it be italicized by default (thus almost all browsers do so), because it (in their view) is only for publication titles. By convention, however, only certain kinds of titles actually take italics, while others are expected to be put in quotation marks, and standards may actually vary by publishing context and language. Consequently, many website authors and admins use a site-wide stylesheet to undo this element's auto-italics. }} {{term|term=data |content= {{XMLElement|data|Data}} }} {{defn|1= Links inline content with a machine-readable translation.}} {{defn|'''Standardized''' in [[#HTML5|HTML5]].<ref>{{cite web|url=https://developer.mozilla.org/en-US/docs/Web/HTML/Element/data|title=<data>|website=MDN Web Docs}}</ref>}} {{term|term=del |content= {{XMLElement|del|Deleted}} }} {{defn|1= Deleted text. Typically rendered as a [[strikethrough]]: <del>Deleted text.</del>}} {{defn|'''Standardized''' in [[#HTML401|HTML 4.0]]; still current.}} {{term|term=ins |content= {{XMLElement|ins|Inserted}} }} {{defn|1= Inserted text. Often used to mark up replacement text for material struck with {{tag|del|o}} or {{tag|s|o}}. Typically rendered [[underline]]d: <ins>Inserted text.</ins>}} {{defn|'''Standardized''' in [[#HTML401|HTML 4.0]]; still current.}} {{defn|Both {{tag|ins|o}} and {{tag|del|o}} elements may also 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 paragraphs and ending in a final paragraph would need to use three separate {{tag|del|o}} elements. Two {{tag|del|o}} elements would be required as inline elements 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.}} {{term|term=mark |content= {{XMLElement|mark|Mark}} }} {{defn|1= Produces text that looks <mark>like this</mark>. Intended for highlighting relevant text in a quotation.}} {{defn|'''Standardized''' in [[#HTML5|HTML5]].}} {{term|term=q |content= {{XMLElement|q|Quote}} }} {{defn|1= An inline quotation (for block level quotation see {{tag|[[#blockquote|blockquote]]|o}}). Quote elements may be nested. {{tag|q|o}} {{em|should}} automatically generate quotation marks in conjunction with style sheets. Practical concerns due to browser non-compliance may force authors to find workarounds. The <code>cite</code> attribute gives the source, and must be a fully qualified [[Uniform Resource Identifier|URI]]. }} {{defn|'''Standardized''' in [[#HTML401|HTML 4.0]]; still current.}} {{defn|{{strong|Note:}} Lengthy inline quotations may be displayed as indented blocks (as <code>block-quote</code>) using style sheets. For example, with a suitable CSS rule associated with <code>q.lengthy</code>: {{tag|q|attribs=class="lengthy" |content=Lengthy quote here.}}}} {{term|term=rb |content= {{XMLElement|rb|Ruby Annotation Base}} }} {{defn|1= Represents the base component of a [[Ruby character|ruby annotation]].}} {{defn|'''Standardized''' in [[#HTML5|HTML5]].<ref>{{cite web|url=http://www.quackit.com/html/tags/html_rb_tag.cfm|title=HTML <rb> Tag|website=www.quackit.com}}</ref>}} {{term|term=rp |content= {{XMLElement|rp|Ruby Fallback Parenthesis}} }} {{defn|1= Provides fallback parenthesis for browsers lacking [[Ruby character|ruby annotation]] support.}} {{defn|'''Standardized''' in [[#HTML5|HTML5]].<ref>{{cite web|url=https://developer.mozilla.org/en-US/docs/Web/HTML/Element/rp|title=<rp>: The Ruby Fallback Parenthesis element|website=MDN Web Docs}}</ref>}} {{term|term=rt |content= {{XMLElement|rt|Ruby Annotation Pronunciation}} }} {{defn|1= Indicates pronunciation for a character in a [[Ruby character|ruby annotation]].}} {{defn|'''Standardized''' in [[#HTML5|HTML5]].<ref>{{cite web|url=https://developer.mozilla.org/en-US/docs/Web/HTML/Element/rt|title=<rt>: The Ruby Text element|website=MDN Web Docs}}</ref>}} {{term|term=rtc |content= {{XMLElement|rtc|Ruby Semantic Annotation}} }} {{defn|1= Semantic annotations for a [[Ruby character|ruby annotation]].}} {{defn|'''Standardized''' in [[#HTML5|HTML5]].<ref>{{cite web|url=https://developer.mozilla.org/en-US/docs/Web/HTML/Element/rtc|title=<rtc>: The Ruby Text Container element|website=MDN Web Docs}}</ref>}} {{term|term=ruby |content= {{XMLElement|ruby|Ruby Annotation}} }} {{defn|1= Represents a [[Ruby character|ruby annotation]] for showing the pronunciation of East Asian characters.}} {{defn|'''Standardized''' in [[#HTML5|HTML5]].<ref>{{cite web|url=https://developer.mozilla.org/en-US/docs/Web/HTML/Element/ruby|title=<ruby>|website=MDN Web Docs}}</ref>}} {{term|term=script |content= {{XMLElement|script|Script}} }} {{defn|1= Places a [[scripting language|script]] in the document. Also usable in the head and in block contexts. {{em|Note:}} {{tag|script|o}} is not itself either a block or inline element; by itself it should not display at all, but it can contain instructions to dynamically generate either both block or inline content. }} {{defn|'''Standardized''' in [[#HTML32|HTML 3.2]]; still current.}} {{term|term=sub |content= {{XMLElement|sub|Subscript}} }} {{term|term=sup |content= {{XMLElement|sup|Superscript}} |multi=y}} {{defn|1= Mark <sub>[[subscript]]ed</sub> or <sup>[[superscript]]ed</sup> text. (Equivalent CSS: {{code|lang=css|code={ vertical-align: sub; } }} and {{code|lang=css|code={ vertical-align: super; } }}, respectively.)}} {{defn|Both were proposed in the [[#HTML30|HTML 3.0 Drafts]]; '''Standardized''' in [[#HTML32|HTML 3.2]]; still current.}} {{term|term=template |content= {{XMLElement|template|Template}} }} {{defn|1= Code fragments to be copied by scripts.}} {{defn|'''Standardized''' in [[#HTML5|HTML5]].<ref>{{cite web|url=https://developer.mozilla.org/en-US/docs/Web/HTML/Element/template|title=<template>|website=MDN Web Docs}}</ref>}} {{term|term=time |content= {{XMLElement|time|Time}} }} {{defn|1= Represents a time on the 24-hour clock or a date on the [[Gregorian calendar]], optionally with time and time zone information. Also allows times and dates to be represented in a machine-readable format.}} {{defn|'''Standardized''' in [[#HTML5|HTML5]].<ref>{{cite web|url=https://developer.mozilla.org/en-US/docs/Web/HTML/Element/time|title=<time>|website=MDN Web Docs}}</ref>}} {{term|term=wbr |content= {{XMLElement|wbr|Word Break Opportunity|end=no}} }} {{defn|1= An optional word break.}} {{defn|Was widely used (and supported by all major browsers){{Citation needed|date=September 2023}} for years{{Clarify timeframe|date=September 2023}} despite being non-standard until finally being '''standardized''' in [[#HTML5|HTML5]].<ref>{{cite web|url=https://developer.mozilla.org/en-US/docs/Web/HTML/Element/wbr|title=<wbr>|website=MDN Web Docs}}</ref>}} {{glossary end}} ===Images and objects=== {{Update section|reason=How do current browsers handle <applet>? What does HTML 5 say about it?|date=July 2023}} {{glossary}} {{term|term=applet |content= {{XMLElement|applet|Java Applet|deprecated=xhtml}} }} {{defn|1= Embeds a [[Java applet]] in the page. Deprecated in favor of {{tag|object|o}}, as it could only be used with Java applets, and had accessibility limitations.}} {{defn|'''Standardized''' in [[#HTML32|HTML 3.2]]; '''deprecated''' in [[#HTML401|HTML 4.0 Transitional]]; '''invalid''' in [[#HTML401|HTML 4.0 Strict]]. As of 2011, still widely used as the implementations of the replacing {{tag|object|o}} are not consistent between different browsers.}} {{term|term=area |content= {{XMLElement|area|Area|end=no}} }} {{defn|1= Specifies a [[Focus (computing)|focusable]] area in a {{tag|map|o}}.}} {{defn|'''Standardized''' in [[#HTML32|HTML 3.2]]; still current.}} {{term|term=audio |content= {{XMLElement|audio|Audio}} }} {{defn|1= Adds playable [[HTML audio]] to the page. The audio URL is determined using the <code>src</code> attribute. Supported audio formats vary from browser to browser.}} {{defn|'''Standardized''' in [[#HTML5|HTML5]].}} {{term|term=canvas |content= {{XMLElement|canvas|Canvas}} }} {{defn|1= {{Main|Canvas element}} Adds a canvas whose contents can be edited with [[JavaScript]]. Frequently used for online games.}} {{defn|'''Standardized''' in [[#HTML5|HTML5]].}} {{term|term=embed |content= {{XMLElement|embed|Embed}} }} {{defn|1= Inserts a non-standard object (like applet) or external content (typically non-HTML) into the document.}} {{defn|Deprecated in HTML 4 in favor of {{tag|object|o}}, but then was added back into the HTML5 specification<ref>[http://webdesign.about.com/od/htmltags/p/bltags_embed.htm Jennifer Kyrnin ] {{Webarchive|url=https://web.archive.org/web/20121102014318/http://webdesign.about.com/od/htmltags/p/bltags_embed.htm |date=2012-11-02 }} {{tag|embed|o}}</ref><ref>[https://www.w3schools.com/tags/tag_embed.asp W3Schools] about {{tag|embed|o}}</ref>}} {{term|term=img |content= {{XMLElement|img|Image|end=no}} }} {{defn|1= Used by visual user agents to insert an [[image]] in the document. The <code>src</code> attribute specifies the image URL. The required [[Alt attribute|<code>alt</code> attribute]] provides alternative text in case the image cannot be displayed.<ref>The alt attribute's text cannot be styled with markup; as a result, other methods of alternative text presentation, such as [[Fahrner Image Replacement]], have been devised to accommodate situations in which the coder wishes styled text to be displayed if images are disabled in a user's browser.</ref> (Though <code>alt</code> is intended as alternative text, Microsoft [[Internet Explorer]] 7 and below render it as a [[tooltip]] if no <code>title</code> attribute is given.<ref>{{cite web | url=http://msdn.microsoft.com/en-us/library/cc288472.aspx#access | title=What's New in Internet Explorer 8 – Accessibility and ARIA | publisher=Microsoft | website=[[Microsoft Developer Network|MSDN]] | access-date=2009-07-22}}</ref> [[Safari (web browser)|Safari]] and [[Google Chrome]], on the other hand, do not display the alt attribute at all.)<ref>{{citation|url=https://bugs.webkit.org/show_bug.cgi?id=5566 |title=Bug 5566 – ALT attribute value sometimes not displayed when image is missing |publisher=Bugs.webkit.org |access-date=2012-03-26}}</ref> The {{tag|img|s}} element was first proposed by [[Marc Andreessen]] and implemented in the [[Mosaic (web browser)|NCSA Mosaic]] web browser.<ref>{{citation|url=http://1997.webhistory.org/www.lists/www-talk.1993q1/0182.html |title=WWW-Talk Jan-Mar 1993: proposed new tag: IMG |publisher=1997.webhistory.org |access-date=2012-03-26}}</ref>}} {{defn|<code>IMG</code> existed in ''[[#HTMLDRAFT12|HTML Internet Draft 1.2]]'', and was '''standardized''' in [[#HTML20|HTML 2.0]]; still current.}} {{term|term=map |content= {{XMLElement|map|Image Map}} }} {{defn|1= Specifies a client-side [[image map]].}} {{defn|'''Standardized''' in [[#HTML32|HTML 3.2]]; still current.}} {{term|term=object |content= {{XMLElement|object|Object}} }} {{defn|1= Includes an object in the page of the type specified by the <code>type</code> attribute. This may be in any [[MIME]]-type the user agent understands, such as an embedded HTML page, a file to be handled by a plug-in such as [[Adobe Flash Player|Flash]], a [[Java (programming language)|Java]] [[applet]], a sound file, etc.}} {{defn|'''Standardized''' in [[#HTML401|HTML 4.0]]; still current.}} {{term|term=param |content= {{XMLElement|param|Object Parameter|end=no}} }} {{defn|1= Originally introduced with {{tag|applet|o}}, this element is now used with {{tag|object|o}}, and should only occur as a child of {{tag|object|o}}. It uses [[HTML attributes]] to set a parameter for the object, e.g. width, height, font, background color, etc., depending on the type of object. An object can have multiple {{tag|param|s}} elements.}} {{defn|'''Standardized''' in [[#HTML32|HTML 3.2]]; still current.}} {{term|term=source |content= {{XMLElement|source|Source}} }} {{defn|1= Specifies different sources for audio or video. Makes use of the <code>src</code> attribute in a way similar to the {{tag|video|o}} and {{tag|audio|o}} elements.}} {{defn|'''Standardized''' in [[#HTML5|HTML5]].}} {{term|term=track |content= {{XMLElement|track|Track}} }} {{defn|1= Provides text tracks, like subtitles and captions, for audio and video.}} {{defn|'''Standardized''' in [[#HTML5|HTML5]].}} {{term|term=video |content= {{XMLElement|video|Video}} }} {{defn|1= Adds a playable [[HTML video]] to the page. The video URL is determined using the <code>src</code> attribute. Supported video formats vary from browser to browser.}} {{defn|'''Standardized''' in [[#HTML5|HTML5]].}} {{glossary end}} ===Forms=== {{Main|Form (HTML)}} These elements can be combined into a form or in some instances used separately as user-interface controls; in the document, they can be simple HTML or used in conjunction with Scripts. HTML markup specifies the elements that make up a form, and the method by which it will be submitted. However, some form of scripts ([[server-side script|server-side]], client-side, or both) must be used to process the user's input once it is submitted. (These elements are either block or inline elements, but are collected here as their use is more restricted than other inline or block elements.) {{glossary}} {{term|term=form |content= {{XMLElement|form|Form|atr={{XMLAttribute|action|Action|url|type=URL|need=required}}}} }} {{defn|1= Creates a [[form (web)|form]]. The {{tag|form|o}} element specifies and operates the overall action of a form area, using the required <code>action</code> attribute.}} {{defn|'''Standardized''' in [[#HTML20|HTML 2.0]]; still current.}} {{term|term=button |content= {{XMLElement|button|Button}} }} {{defn|1= A generic form button which can contain a range of other elements to create complex buttons.}} {{defn|'''Standardized''' in [[#HTML401|HTML 4.0]]; still current.}} {{term|term=datalist |content= {{XMLElement|datalist|Data List}} }} {{defn|1= A list of <code>option</code>s for use in form elements.}} {{defn|'''Standardized''' in [[#HTML5|HTML5]].}} {{term|term=fieldset |content= {{XMLElement|fieldset|Fieldset}} }} {{defn|1= A container for adding structure to forms. For example, a series of related controls can be grouped within a {{tag|fieldset|o}}, which can then have a {{tag|legend|o}} added in order to identify their function.}} {{defn|'''Standardized''' in [[#HTML401|HTML 4.0]]; still current.}} {{term|term=input |content= {{XMLElement|input|Input|end=no}} }} {{defn|1= {{tag|input|o}} elements allow a variety of standard form controls to be implemented.}} {{defn|'''Standardized''' in [[#HTML20|HTML 2.0]]; still current.}} {{defn|1='''Input Types:''' {{glossary}} {{term|term=checkbox |content= {{XMLAttribute|type|Field Type|checkbox|type=ENUM|need=implied}} }} {{defn|A '''[[checkbox]]'''. Can be checked or unchecked.}} {{term|term=radio |content= {{XMLAttribute|type|Field Type|radio|type=ENUM|need=implied}} }} {{defn|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.}} {{term|term=button |content= {{XMLAttribute|type|Field Type|button|type=ENUM|need=implied}} }} {{defn|A general-purpose button. The element {{tag|button|o}} is preferred if possible (i.e., if the client supports it) as it provides richer possibilities.}} {{term|term=submit |content= {{XMLAttribute|type|Field Type|submit|type=ENUM|need=implied}} }} {{defn|A '''submit''' button.}} {{term|term=image |content= {{XMLAttribute|type|Field Type|image|type=ENUM|need=implied}} }} {{defn|An '''image button'''. The image URL may be specified with the <code>src</code> attribute.}} {{term|term=reset |content= {{XMLAttribute|type|Field Type|reset|type=ENUM|need=implied}} }} {{defn|A '''reset button''' for resetting the form to default values.}} {{term|term=text |content= {{XMLAttribute|type|Field Type|text|type=ENUM|need=optional}} }} {{defn|A '''one-line text input field'''. The <code>size</code> attribute specifies the default width of the input in character-widths. <code>max-length</code> sets the maximum number of characters the user can enter (which may be greater than size).}} {{term|term=search |content= {{XMLAttribute|type|Field Type|search|type=ENUM|need=implied}} }} {{defn|A variation of <code>text</code> which produces a search bar.}} {{term|term=password |content= {{XMLAttribute|type|Field Type|password|type=ENUM|need=implied}} }} {{defn|A variation of <code>text</code>. The difference is that text typed in this field is {{em|masked}} – characters are displayed as an asterisk, a dot, or another replacement. The password is still submitted to the server as [[plaintext]], so an underlying secure [[communication protocol]] like [[HTTPS]] is needed if confidentiality is a concern.}} {{term|term=file |content= {{XMLAttribute|type|Field Type|file|type=ENUM|need=implied}} }} {{defn|A [[file select]] field (for uploading files to a server).}} {{term|term=tel |content= {{XMLAttribute|type|Field Type|tel|type=ENUM|need=implied}} }} {{defn|A variation of <code>text</code> for [[telephone numbers]].}} {{term|term=email |content= {{XMLAttribute|type|Field Type|email|type=ENUM|need=implied}} }} {{defn|A variation of <code>text</code> for [[email addresses]].}} {{term|term=url |content= {{XMLAttribute|type|Field Type|url|type=ENUM|need=implied}} }} {{defn|A variation of <code>text</code> for [[URLs]].}} {{term|term=date |content= {{XMLAttribute|type|Field Type|date|type=ENUM|need=implied}} }} {{defn|A date selector.}} {{term|term=time |content= {{XMLAttribute|type|Field Type|time|type=ENUM|need=implied}} }} {{defn|A time selector.}} {{term|term=number |content= {{XMLAttribute|type|Field Type|number|type=ENUM|need=implied}} }} {{defn|A variation of <code>text</code> for numbers.}} {{term|term=range |content= {{XMLAttribute|type|Field Type|range|type=ENUM|need=implied}} }} {{defn|Produces a slider for that returns a number, but the number is not visible to the user.}} {{term|term=color |content= {{XMLAttribute|type|Field Type|color|type=ENUM|need=implied}} }} {{defn|A color picker.}} {{term|term=hidden |content= {{XMLAttribute|type|Field Type|hidden|type=ENUM|need=implied}} }} {{defn|<code>hidden</code> inputs are not visible in the rendered page, but allow a designer to maintain a copy of data that needs to be submitted to the server as part of the form. This may, for example, be data that this web user entered or selected on a previous form that needs to be processed in conjunction with the current form. Not displayed to the user but data can still be altered client-side by editing the HTML source.}} {{glossary end}} }} {{term|term=isindex |content= {{XMLElement|isindex|Index|end=no|deprecated=1}} }} {{defn|1= {{tag|isindex|s}} could either appear in the document head or in the body, but only once in a document. {{tag|isindex|s}} operated as a primitive HTML search form; but was {{lang|la|[[de facto]]}} obsoleted by more advanced HTML forms introduced in the early to mid-1990s. Represents a set of hyperlinks composed of a base URI, an [[ampersand]] and [[Percent-encoding|percent-encoded]] keywords separated by [[plus sign]]s.}} {{defn|<code>ISINDEX</code> existed in ''[[#HTMLTAGS|HTML Tags]]''; '''standardized''' in [[#HTML20|HTML 2.0]]; '''deprecated''' in [[#HTML401|HTML 4.0 Transitional]]; '''invalid''' in [[#HTML401|HTML 4.0 Strict]].}} {{term|term=keygen |content= {{XMLElement|keygen|Key pair generator|deprecated=1}} }} {{defn|1= A key pair generator.}} {{defn|'''Standardized''' in [[#HTML5|HTML5]], but removed in HTML 5.2.}} {{term|term=label |content= {{XMLElement|label|Label|atr={{XMLAttribute|for|For|id|type=ENUM|need=implied}}}} }} {{defn|1= Creates a label for a form input, such as <code>radio</code>. Clicking on the label fires a click on the matching input.}} {{defn|'''Standardized''' in [[#HTML401|HTML 4.0]]; still current.}} {{term|term=legend |content= {{XMLElement|legend|Legend}} }} {{defn|1= A legend (caption) for a {{tag|fieldset|o}}.}} {{defn|'''Standardized''' in [[#HTML401|HTML 4.0]]; still current.}} {{term|term=meter |content= {{XMLElement|meter|Meter}} }} {{defn|1= A meter which needs a <code>value</code> attribute. Can also have: <code>min</code>, <code>low</code>, <code>high</code>, and <code>max</code>.}} {{defn|'''Standardized''' in [[#HTML5|HTML5]].}} {{term|term=option |content= {{XMLElement|option|Select List Option|atr={{XMLAttribute|value|Value|x|type=ANY|need=required}}}} }} {{defn|1= Creates an item in a {{tag|select|o}} list.}} {{defn|'''Standardized''' in [[#HTML20|HTML 2.0]]; still current.}} {{term|term=optgroup |content= {{XMLElement|optgroup|Options Group}} }} {{defn|1= Identifies a group of {{tag|option|o}} elements in a {{tag|select|o}} list.}} {{defn|'''Standardized''' in [[#HTML401|HTML 4.0]]; still current.}} {{term|term=output |content= {{XMLElement|output|Output}} }} {{defn|1= The value of a form element.}} {{defn|'''Standardized''' in [[#HTML5|HTML5]].}} {{term|term=progress |content= {{XMLElement|progress|Progress Bar}} }} {{defn|1= A bar for showing the progress of an action.}} {{defn|'''Standardized''' in [[#HTML5|HTML5]].}} {{term|term=select |content= {{XMLElement|select|Selection List|atr={{XMLAttribute|name|Name|xyz|type=NMTOKEN|need=implied}}}} }} {{defn|1= Creates a selection list, from which the user can select a single option. May be rendered as a dropdown list.}} {{defn|'''Standardized''' in [[#HTML20|HTML 2.0]]; still current.}} {{term|term=textarea |content= {{XMLElement|textarea|Multiline Textarea|atr={{XMLAttribute|rows|Rows|8|type=INT}}}} }} {{defn|1= A multiple-line text area, the size of which is specified by <code>cols</code> (where a column is a one-character width of text) and <code>rows</code> [[HTML attributes]]. The content of this element is restricted to plain text, which appears in the text area as default text when the page is loaded.}} {{defn|'''Standardized''' in [[#HTML20|HTML 2.0]]; still current.}} {{glossary end}} ===Tables=== The format of HTML Tables was proposed in the [[#HTML30|HTML 3.0 Drafts]] and the later RFC 1942 ''[[#HTMLTABLES|HTML Tables]]''. They were inspired by the [[CALS Table Model]]. Some elements in these proposals were included in HTML 3.2; the present form of HTML Tables was standardized in HTML 4. (Many of the elements used within tables are neither ''block'' nor ''inline'' elements.) {{glossary}} {{term|term=table |content= {{XMLElement|table|Table}} }} {{defn|1= Identifies a table. Several [[HTML attributes]] are possible in HTML Transitional, but most of these are invalid in HTML Strict and can be replaced with style sheets. The <code>summary</code> attribute is informally required for accessibility purposes, though its usage is not simple.}} {{defn|Proposed in the [[#HTML30|HTML 3.0 Drafts]]; '''Standardized''' in [[#HTML32|HTML 3.2]]; still current.}} {{term|term=tr |content= {{XMLElement|tr|Table Row}} }} {{defn|1= Contains a row of cells in a {{tag|table|o}}.}} {{defn|Proposed in the [[#HTML30|HTML 3.0 Drafts]]; '''Standardized''' in [[#HTML32|HTML 3.2]]; still current.}} {{term|term=th |content= {{XMLElement|th|Table Header Cell}} }} {{defn|1= A {{tag|table|o}} header cell; contents are conventionally displayed bold and centered. An [[aural]] user agent may use a louder voice for these items.}} {{defn|Proposed in the [[#HTML30|HTML 3.0 Drafts]]; '''Standardized''' in [[#HTML32|HTML 3.2]]; still current.}} {{term|term=td |content= {{XMLElement|td|Table Data Cell}} }} {{defn|1= A {{tag|table|o}} data cell.}} {{defn|Proposed in the [[#HTML30|HTML 3.0 Drafts]]; '''Standardized''' in [[#HTML32|HTML 3.2]]; still current.}} {{term|term=colgroup |content= {{XMLElement|colgroup|Column Group}} }} {{defn|1= Specifies a [[column group]] in a {{tag|table|o}}.}} {{defn|Proposed in [[#HTMLTABLES|HTML Tables]]; '''Standardized''' in [[#HTML401|HTML 4.0]]; still current.}} {{term|term=col |content= {{XMLElement|col|Table Column}} }} {{defn|1= Specifies a column in a {{tag|table|o}}.}} {{defn|Proposed in [[#HTMLTABLES|HTML Tables]]; '''Standardized''' in [[#HTML401|HTML 4.0]]; still current.}} {{term|term=caption |content= {{XMLElement|caption|Table Caption}} }} {{defn|1= Specifies a caption for a {{tag|table|o}}.}} {{defn|Proposed in the [[#HTML30|HTML 3.0 Drafts]]; '''Standardized''' in [[#HTML32|HTML 3.2]]; still current.}} {{term|term=thead |content= {{XMLElement|thead|Table Header}} }} {{defn|1= Specifies the header part of a {{tag|table|o}}. This section may be repeated by the user agent if the table is split across pages (in printing or other paged media).}} {{defn|Proposed in [[#HTMLTABLES|HTML Tables]]; '''Standardized''' in [[#HTML401|HTML 4.0]]; still current.}} {{term|term=tbody |content= {{XMLElement|tbody|Table Body}} }} {{defn|1= Specifies a body of data for a {{tag|table|o}}.}} {{defn|Proposed in [[#HTMLTABLES|HTML Tables]]; '''Standardized''' in [[#HTML401|HTML 4.0]]; still current.}} {{term|term=tfoot |content= {{XMLElement|tfoot|Table Footer}} }} {{defn|1= Specifies the footer part of a {{tag|table|o}}. Like {{tag|thead|o}}, this section may be repeated by the user agent if the table is split across pages (in printing or other paged media).}} {{defn|Proposed in [[#HTMLTABLES|HTML Tables]]; '''Standardized''' in [[#HTML401|HTML 4.0]]; still current.}} {{glossary end}} ==Frames== {{Main|Frame (World Wide Web)}} Frames allow a visual HTML browser window to be split into segments, each of which can show a different document. This can lower bandwidth use, as repeating parts of a layout can be used in one frame, while variable content is displayed in another. This may come at a certain usability cost, especially in non-visual user agents,<ref>{{cite web|url=http://www.washington.edu/doit/are-frames-accessible|title=Are frames accessible?|quote=...frames do present additional usability challenges that are unique to users with disabilities, particularly those who use screen readers.}}</ref> due to separate and independent documents (or websites) being displayed adjacent to each other and being allowed to interact with the same parent window. Because of this cost, frames (excluding the {{tag|iframe|o}} element) are only allowed in HTML 4.01 Frame-set. Iframes can also hold documents on different servers. In this case the interaction between windows is blocked by the browser. Sites like [[Facebook]] and [[Twitter]] use iframes to display content ([[Plug-in (computing)|plugins]]) on third party websites. Google [[AdSense]] uses iframes to display banners on third party websites. In HTML 4.01, a document may contain a {{tag|head|o}} and a {{tag|body|o}} {{em|or}} a {{tag|head|o}} and a {{tag|frameset|o}}, but not both a {{tag|body|o}} and a {{tag|frameset|o}}. However, {{tag|iframe|o}} can be used in a normal document body. {{glossary}} {{term|term=frameset |content= {{XMLElement|frameset|Frameset|deprecated=1}} }} {{defn|1= Contains the set of {{tag|frame|s}} elements for a document. The layout of frames is given by comma separated lists in the <code>rows</code> and <code>cols</code> [[HTML attributes]].}} {{defn|'''Standardized''' in [[#HTML401|HTML 4.0]] Frameset, '''obsolete''' in HTML5.}} {{term|term=frame |content= {{XMLElement|frame|Frame|end=no|deprecated=1}} }} {{defn|1= Defines a single frame, or region, within the {{tag|frameset|o}}. A separate document is linked to a frame using the <code>src</code> attribute inside the {{tag|frame|s}} element.}} {{defn|'''Standardized''' in [[#HTML401|HTML 4.0]] Frameset, '''obsolete''' in HTML5.}} {{term|term=noframes |content= {{XMLElement|noframes|Frame Support Fallback|deprecated=1}} }} {{defn|1= Contains normal HTML content for user agents that do not support {{tag|frame|s}} elements.}} {{defn|'''Standardized''' in [[#HTML401|HTML 4.0]] Transitional, '''obsolete''' in HTML5.}} {{term|term=iframe |content= {{XMLElement|iframe|Inline Frame}} }} {{defn|1= An inline frame places another HTML document in a frame. Unlike an {{tag|object|s}} element, an {{tag|iframe|o}} can be the "target" frame for links defined by other elements, and it can be selected by the user agent as the focus for printing, viewing its source, and so on. The content of the element is used as alternative text to be displayed if the browser does not support inline frames. A separate document is linked to a frame using the <code>src</code> attribute inside the {{tag|iframe|s}}, an inline HTML code is embedded to a frame using the <code>srcdoc</code> attribute inside the {{tag|iframe|s}} element.}} {{defn|First introduced by Microsoft Internet Explorer in 1997, '''standardized''' in [[#HTML401|HTML 4.0]] Transitional, '''allowed''' in HTML5.}} {{glossary end}} ===<code>longdesc</code> attribute=== In [[HTML]], '''<code>longdesc</code>''' is an attribute used within the {{tag|img|s}}, {{tag|frame|s}}, or {{tag|iframe|o}} elements. It is supposed to be a [[URL]]{{refn|group=note|Strictly an [[Internationalized resource identifier|IRI]], not a URL; although URLs are a subset of IRIs.}} to a document that provides a '''long description''' for the image, frame, or iframe in question.<ref>{{cite web|url=http://www.w3.org/TR/REC-html40/struct/objects.html|title=Objects, Images, and Applets|publisher=W3C|access-date=2008-12-20}}</ref> This attribute should contain a URL, {{em|not}} – as is commonly mistaken – the text of the description itself. <code>longdesc</code> was designed to be used by [[screen reader]]s to display image information for computer users with [[accessibility]] issues, such as the blind or [[Visual_impairment |visually impaired]], and is widely implemented by both web browsers and screen readers.<ref>{{cite web|url=http://www.w3.org/html/wg/wiki/ChangeProposals/InstateLongdesc/Implementation|title=InState Longdesc|access-date=2011-09-05}}</ref> Some developers object that<ref>{{cite web|url=http://www.webaim.org/techniques/images/longdesc.php#longdesc|title=Creating Accessible Images|publisher=WebAim|access-date=2008-12-20}}</ref> it is actually seldom used for this purpose because there are relatively few authors who use the attribute and most of those authors use it incorrectly; thus, they recommend deprecating <code>longdesc</code>.<ref>{{citation|url=http://wiki.whatwg.org/wiki/Longdesc_usage |title=Longdesc usage - WHATWG Wiki |publisher=Wiki.whatwg.org |access-date=2012-03-26}}</ref> The publishing industry has responded, advocating the retention of <code>longdesc</code>.<ref>{{cite web|url=http://www.w3.org/Bugs/Public/show_bug.cgi?id=13461|title=Bug 13461 - Commentary on Issue #30 (longdesc) from the Association of American Publishers |access-date=2011-09-05}}</ref> ====Example==== <syntaxhighlight lang="html"> <img src="Hello.jpg" longdesc="description.html"> </syntaxhighlight> <br />Content of <code>description.html</code>: <syntaxhighlight lang="html"> <br /> <p>This is an image of a two-layered birthday cake.</p> ... </syntaxhighlight> ====Linking to the long description in the text==== Since very few graphical browsers support making the link available natively (Opera and iCab being the exceptions), it is useful to include a link to the description page near the {{tag|img|s}} element whenever possible, as this can also aid sighted users. =====Example===== <syntaxhighlight lang="html"> <img src="Hello.jpg" longdesc="description.html" /> [<a href= "description.html" title="long description of the image">D</a>] </syntaxhighlight> ==Historic elements== The following elements were part of the early HTML developed by [[Tim Berners-Lee]] from 1989 to 1991; they are mentioned in ''HTML Tags'', but deprecated in ''HTML 2.0'' and were never part of HTML standards. {{glossary}} {{term|term=listing |content= {{XMLElement|listing|HTML Listing|deprecated=1}} }} {{defn|1= This element displayed the text inside the tags in a monospace font and without interpreting the HTML. The [[#HTML20|HTML 2.0]] specification recommended rendering the element at up to 132 characters per line.}} {{defn|'''Deprecated''' in [[#HTML32|HTML 3.2]]; '''obsolete''' in [[#HTML5|HTML5]].<ref name=WHATWG-deprecated>{{cite web |url= https://html.spec.whatwg.org/multipage/obsolete.html#non-conforming-features |title= Obsolete – Non-conforming features |website= HTML Living Standard |publisher= [[WHATWG]] |access-date= August 7, 2022 |date= July 22, 2022}}</ref>}} {{term|term=plaintext |content= {{XMLElement|plaintext|Plaintext|deprecated=1|end=no|noslash=yes}} }} {{defn|1= {{tag|plaintext|open}} does not have an end tag as it terminates the markup and causes the rest of the document to be parsed as if it were [[plaintext]].}} {{defn|{{tag|plaintext|open}} existed in ''[[#HTMLTAGS|HTML Tags]]''; '''deprecated''' in [[#HTML20|HTML 2.0]]; '''invalid''' in [[#HTML401|HTML 4.0]].}} {{term|term=xmp |content= {{XMLElement|xmp|HTML Example|deprecated=1}} }} {{defn|1= This element displayed the text inside the tags in a monospace font and without interpreting the HTML. The [[#HTML20|HTML 2.0]] specification recommended rendering the element at 80 characters per line.}} {{defn|'''Deprecated''' in [[#HTML32|HTML 3.2]]; '''obsolete''' in [[#HTML5|HTML5]].<ref>{{cite web|url=https://developer.mozilla.org/en-US/docs/Web/HTML/Element/xmp|title=<xmp>|website=MDN Web Docs|date=24 February 2023 }}</ref>}} {{term|term=nextid |content= {{XMLElement|nextid|NeXT ID|deprecated=1|end=no|noslash=yes}} }} {{defn|1= This element enabled NeXT web designing tool to generate automatic NAME labels for its anchors and was itself automatically generated.<ref name=WHATWG-deprecated />}} {{defn|{{tag|nextid|open}} existed in ''[[#HTMLTAGS|HTML Tags]]'' (described as obsolete); '''deprecated''' in [[#HTML20|HTML 2.0]]; '''invalid''' in [[#HTML32|HTML 3.2]] and later.}} {{glossary end}} ==Non-standard elements== {{Quote box | width = 250px | class = noprint | quote = <div style="font-size: 100%; color:#FF00CC;">{{marquee|This is the new WikiPedia!}}</div> | source = Example of marquee text from the [[first Wikipedia edit]] (accomplished via CSS; the <marquee> tag itself is deprecated and no longer works in most browsers) }} {{Quote box | width = 250px | class = noprint | quote = {{blink|[[WP:UuU|UuU]]}} | source = Example of blinking text (accomplished via CSS; the <blink> tag itself is deprecated and no longer works in most browsers) with link to page. Not to be confused with [[UwU]], this page contains the earliest surviving edit on the English Wikipedia.}} This section lists some widely used obsolete elements, which means they are not used in [[Validator|valid]] code. They may not be supported in all user agents. {{glossary}} {{term|term=blink |content= {{XMLElement|blink|Blink|deprecated=1}} }} {{defn|1= {{Main|Blink element}} Causes text to blink. Introduced in imitation of the [[ANSI escape code]]s. Can be done with CSS where supported: {{code|lang=css|code={text-decoration: blink} }} (This effect may have negative consequences for people with [[photosensitive epilepsy]];<ref name="WCAG">{{cite web|url=http://www.w3.org/TR/WCAG10/|title=Web Content Accessibility Guidelines 1.0|first1=Wendy|last1=Chisholm|first2=Gregg|last2=Vanderheiden|first3=Ian|last3=Jacobs|publisher=World Wide Web Consortium|date=1999-05-05|access-date=2010-07-20}}</ref> its use on the public Internet should follow the appropriate guidelines.)}} {{defn|{{code|lang=html|code=<blink>}} originated in [[Netscape Navigator]] and is mostly recognized by its descendants, including [[Firefox]]; '''deprecated''' or '''invalid''' in [[#HTML20|HTML 2.0]] and later. The replacement CSS tag, while standard, is not required to be supported.}} {{term|term=layer |content= {{XMLElement|layer|Layer|deprecated=1}} }} {{defn|1= {{Main|Layer element}} Creates an absolute positioned and framed layer. Can be done with frames and/or CSS instead. There are attributes, including '''ID''', '''LEFT''', '''TOP''', '''PAGEX''', '''PAGEY''', '''SRC''', '''Z-INDEX''', '''ABOVE''', '''WIDTH''', '''HEIGHT''', '''BELOW''', '''CLIP''', '''VISIBILITY''' and '''CLIP'''.}} {{defn|{{code|lang=html|code=<layer>}} originated in [[Netscape 4]]; '''deprecated''' or '''invalid''' in [[#HTML401|HTML 4.01]] and later.}} {{term|term=marquee |content= {{XMLElement|marquee|Marquee|deprecated=1}} }} {{defn|1= {{Main|Marquee element}} Creates scrolling text. Can be done with scripting instead. (This effect may have negative consequences for people with [[photosensitive epilepsy]];<ref name="WCAG" /> its use on the public Internet should follow the appropriate guidelines.) There are three options, including '''Alternate''', '''Scroll''' and '''slide'''. '''Scrolldelay''' can also be added.}} {{defn|{{code|lang=html|code=<marquee>}} originated in [[Microsoft Internet Explorer]]; '''deprecated''' or '''invalid''' in [[#HTML401|HTML 4.01]] and later.}} {{term|term=nobr |content= {{XMLElement|nobr|No Break|deprecated=1}} }} {{defn|1= Causes text to not break at end of line, preventing word wrap where text exceeds the width of the enclosing object. Adjacent text may break before and after it. Can be done with CSS: {{code|lang=css|code={white-space: nowrap;} }}}} {{defn|{{code|lang=html|code=<nobr>}} is a proprietary element which is recognized by most browsers for compatibility reasons; '''deprecated''' or '''invalid''' in [[#HTML20|HTML 2.0]] and later.}} {{term|term=noembed |content= {{XMLElement|noembed|Embed Fallback|deprecated=1}} }} {{defn|1= Specifies alternative content, if the embed cannot be rendered. Replaced by the content of the {{code|lang=html|code=<embed>}} or {{code|lang=html|code=<object>}} element.}} {{glossary end}} ==Comments== {{Clear}} {{glossary}} {{term|term=comment |content= {{code|lang=html|code=<<nowiki />!-- A Comment -->}} }} {{defn|1= <p>A [[Comment (computer programming)|comment]] in HTML (and related XML, SGML and SHTML) uses the same syntax as the [[SGML comment]] or [[XML comment]], depending on the doctype.</p> <p>Unlike most HTML tags, comments do not nest. More generally, there are some strings that are not allowed to appear in the comment text. Those are {{code|lang=html|code=<!<nowiki />--}}(the beginning of a comment),{{code|lang=html|code=-->}}(this ends the comment so it trivially follows it can not appear inside it) and {{code|lang=html|code=--!>}}. Additionally, the strings {{code|lang=html|code=>}} and {{code|lang=html|code=->}} cannot appear at the beginning of a comment and {{code|lang=html|code=<!-}} cannot appear at the end.<ref>{{cite web|url=https://html.spec.whatwg.org/multipage/syntax.html#comments|title=HTML standard|website=html.spec.whatwg.org}}</ref></p> <p>As a result, the markup {{code|lang=html|code=<!<nowiki />--Xbegin<<nowiki />!--Y-->Xend-->}} is ill-formed and will yield the comment {{samp|{{nobr|Xbegin<!--Y}}}} and the text {{samp|{{nobr|Xend-->}}}} after it, or sometimes just {{samp|Xend-->}}, depending on browser.</p> <p>Comments can appear anywhere in a document, as the HTML parser is supposed to ignore them no matter where they appear so long as they are not inside other HTML tag structures (i.e., they cannot be used next to attributes and values; this is invalid markup: <code>{{nobr|1=<span id="x1"}}{{nobr|<!--for}} "extension {{nobr|one"-->}} {{nobr|1=style="...">}}</code>).</p> <p>Comments can even appear before the doctype declaration; no other tags are permitted to do this.</p> <p>However, not all browsers and HTML editors are fully compliant with the HTML syntax framework and may do unpredictable things under some syntax conditions. Defective handling of comments only affects about 5% of all browsers and HTML editors in use, and even then only certain versions are affected by comment mishandling issues (Internet Explorer 6 accounts for most of this high percentage).</p> <p>There are a few compatibility quirks involving comments:</p> * Placing comments – or indeed any characters except for white-space – before the <code>doctype</code> will cause Internet Explorer 6 to use [[quirks mode]] for the HTML page. None of the <code>doctype</code> information will be processed. * For compatibility with some pre-1995 browsers, the contents of {{tag|style|o}} and {{tag|script|o}} elements are still sometimes surrounded by comment delimiters, and CSS- and script-capable browsers are written to specifically ignore that comment markup as not actually a comment. This means that attempts to actually comment out CSS and script markup by change the elements inside the comment to not be recognized, e.g. <code>{{nobr|<--}} {{nobr|[script]...}}[/script] {{nobr|-->}}</code>. * The [[BlueGriffon]] HTML editor, in versions 1.7.{{var|x}}, makes comments that are not embedded in the syntax structure; {{code|lang=html|code=<style> ... {comment tags} ...</style>}} will show up on-screen. Other HTML editors may have this same defect. }} {{glossary end}} ==See also== * [[HTML attribute]] * [[HTML#Element_examples|HTML element examples]] == Notes == {{Reflist|group=note|liststyle=lower-roman}} ==References== <references/> ==Bibliography== {{refbegin}} ===HTML standards=== ;<span id="HTML20">HTML 2.0{{colon}}</span> :{{cite IETF |last1=Berners-Lee |first1=Tim |author1-link=Tim Berners-Lee |last2=Connolly |first2=Dan |author2-link=Dan Connolly (computer scientist) |title=Hypertext Markup Language - 2.0 (RFC 1866) |publisher=[[IETF]] |date=November 1995 |rfc=1866 |access-date=2009-03-24}} ;<span id="HTML32">HTML 3.2{{colon}}</span> :{{cite web |last=Raggett |first=Dave |author-link=Dave Raggett |title=HTML 3.2 Reference Specification |publisher=[[W3C]] |date=1997-01-14 |url= http://www.w3.org/TR/REC-html32-19970114 |access-date=2009-03-27}} ;<span id="HTML401">HTML 4.01{{colon}}</span> :{{cite web |last1=Raggett |first1=Dave |author-link=Dave Raggett |last2=Le Hors |first2=Arnaud |last3=Jacobs |first3=Ian |title=HTML 4.01 Specification |publisher=[[W3C]] |date=1999-12-24 |url= https://www.w3.org/TR/html4/ |access-date=2009-03-24}} (HTML 4.01 superseded [https://www.w3.org/TR/1998/REC-html40-19980424/ 4.0] (1998), which was never widely implemented, and all earlier versions. Superseded in turn on 2018-03-27 by [[#HTML52|HTML 5.2]]). ;<span id="XHTML10">XHTML 1.0{{colon}}</span> :{{cite web |title=XHTML 1.0: The Extensible HyperText Markup Language (Second Edition) |version=Revised version |publisher=[[W3C]] |date=2002-08-01 |orig-date=2000 |url= https://www.w3.org/TR/xhtml1/ |access-date=2009-03-24}} ;<span id="XHTML11">XHTML 1.1{{colon}}</span> :{{cite web |editor1-last=Altheim |editor1-first=Murray |editor2-last=McCarron |editor2-first=Shane |editor3-last=Ishikawa |editor3-first=Masayasu |title=XHTML 1.1 - Module-based XHTML - Second Edition |version=Revised version |publisher=[[W3C]] |date=2010-11-23 |orig-date=2001 |url= https://www.w3.org/TR/xhtml11/ |access-date=2018-07-26}} ''(Superseded on 2018-03-27 by HTML 5.2.)'' :<span id="XHTML11m"></span>{{cite web |editor1-last=Austin |editor1-first=Daniel |editor2-last=Peruvemba |editor2-first=Subramanian |editor3-last=McCarron |editor3-first=Shane |editor4-last=Ishikawa |editor4-first=Masayasu |editor5-last=Birbeck |editor5-first=Mark |editor6-last=Altheim |editor6-first=Murray |editor7-last=Boumphrey |editor7-first=Frank |editor8-last=Dooley |editor8-first=Sam |editor9-last=Schnitzenbaumer |editor9-first=Sebastian |editor10-last=Wugofski |editor10-first=Ted |title=XHTML Modularization 1.1 - Second Edition |version=Revised version |publisher=[[W3C]] |date=2010-07-29 |orig-date=2006 |url= https://www.w3.org/TR/xhtml-modularization/ |access-date=2018-07-26}} ''(A more detailed version of the above. Also superseded on 2018-03-27 by [[#HTML52|HTML 5.2]].)'' ;<span id="HTML52">W3C HTML 5.2{{colon}}</span> :{{cite web |editor1-last=Faulkner |editor1-first=Steve |editor2-last=Eicholz |editor2-first=Arron |editor3-last=Leithead |editor3-first=Travis |editor4-last=Danilo |editor4-first=Alex |editor5-last=Moon |editor5-first=Sangwhan |editor6-last=Doyle Navara |editor6-first=Erika |editor7-last=O'Connor |editor7-first=Theresa |editor8-last=Berjon |editor8-first=Robin |title=HTML 5.2 W3C Recommendation |version=Revised version |publisher=[[W3C]] |date=2017-12-14 |orig-date=2016 |url= https://www.w3.org/TR/html52/ |access-date=2018-07-26}} ''Supersedes all previous versions of HTML and XHTML, including [https://www.w3.org/TR/html51/ HTML 5.1].'' ;<span id="WHATWGLS">WHATWG HTML5 Living Standard{{colon}}</span><!--Yes, WHATWG uses the run-together "HTML5" spelling.--> :{{cite web |editor-first=Ian |editor-last=Hickson |editor-link=Ian Hickson |title=HTML Living Standard |version=One-page Version |publisher=[[WHATWG]] |date=2018-07-25 |url= https://html.spec.whatwg.org/ |access-date=2018-07-26}} ''Also available as a [https://html.spec.whatwg.org/multipage/ Multipage Version], and [https://html.spec.whatwg.org/dev/ Developer's Edition] (also multi-page, with a search function and other gadgets, and minus details only of interest to browser vendors).'' ===Other sources=== ;''<span id="HTMLTAGS">HTML Tags{{colon}}</span>'' :{{cite web |last=Berners-Lee |first=Tim |author-link=Tim Berners-Lee |title=HTML Tags |date=1992-11-03 |url= http://www.w3.org/History/19921103-hypertext/hypertext/WWW/MarkUp/Tags.html |access-date=2009-03-28}} ''(Part of the first published description of HTML.)'' ;''<span id="HTMLDRAFT12">HTML Internet Draft 1.2{{colon}}</span>'' :{{cite web |last1=Berners-Lee |first1=Tim |author1-link=Tim Berners-Lee |last2=Connolly |first2=Dan |author2-link=Dan Connolly (computer scientist) |title=Hypertext Markup Language (HTML) |date=June 1993 |url= http://www.w3.org/MarkUp/draft-ietf-iiir-html-01.txt |access-date=2009-03-28}} ;''<span id="HTML30">HTML 3.0 Drafts{{colon}}</span>'' :{{cite web |last=Raggett |first=Dave |author-link=Dave Raggett |title=HyperText Markup Language Specification Version 3.0 (draft) |date=1995-03-24 |url= http://www.w3.org/MarkUp/html3/CoverPage.html |access-date=2009-04-18}} ''(This is the final draft of HTML 3.0, which expired without being developed further.)'' ;''<span id="HTMLTABLES">HTML Tables{{colon}}</span>'' :{{cite IETF |last=Raggett |first=Dave |title=HTML Tables (RFC 1942) |publisher=[[IETF]] |date=May 1996 |rfc= 1942 |access-date = 2009-03-22}} ;<span id="XML10">XML 1.0{{colon}}</span> :{{cite web |editor1-last=Bray |editor1-first=Tim |editor1-link=Tim Bray |editor2-last=Paoli |editor2-first=Jean |editor2-link=Jean Paoli |editor3-last=Sperberg-McQueen |editor3-first=C. Michael |editor3-link=Michael Sperberg-McQueen |editor4-last=Maler |editor4-first=Eve |editor5-last=Yergeau |editor5-first=François |title=Extensible Markup Language (XML) 1.0 (Fifth Edition) |publisher=[[W3C]] |date=2008-11-26 |url= http://www.w3.org/TR/xml/ |access-date=2009-03-20}} ;<span id="CSS1">CSS 1{{colon}}</span> :{{cite web |last1=Lie |first1=Håkon Wium |author1-link=Håkon Wium Lie |last2=Bos |first2=Bert |author2-link=Bert Bos |title=Cascading Style Sheets, Level 1 |version=Revised version |publisher=[[W3C]] |date=2008-04-11 |orig-date=1996 |url= http://www.w3.org/TR/CSS1/ |access-date=2018-07-26}} ;<span id="CSS2.1">CSS 2.1{{colon}}</span> :{{cite web |last1=Bos |first1=Bert |author1-link=Bert Bos |last2=Çelik |first2=Tantek |author2-link=Tantek Çelik |last3=Hickson |first3=Ian |author3-link=Ian Hickson |last4=Lie |first4=Håkon Wium |author4-link=Håkon Wium Lie |title=Cascading Style Sheets Level 2 Revision 1 (CSS 2.1) Specification |version=Revised version |publisher=[[W3C]] |date=12 April 2016 |orig-date=2011 |url= https://www.w3.org/TR/CSS2/ |access-date=2018-07-26}} ;CSS 3 and 4{{colon}} :{{cite web |last1=Atkins |first1=Tab Jr. |last2=Eternad |first2=Elika J. |last3=Rivoal |first3=Florian |title=CSS Snapshot 2017 |at=§2. Cascading Style Sheets (CSS) – The Official Definition |publisher=[[W3C]] |date=31 January 2017 |url= https://www.w3.org/TR/CSS/#css |access-date=2018-07-26}} ''(List of active specifications that have superseded CSS 2.1, as of the publication date.)'' :{{cite web |author=<!--Staff writer(s); no by-line.--> |title=CSS Current Status |publisher=[[W3C]] |date=2018 |url= https://www.w3.org/standards/techs/css#w3c_all |access-date=2018-07-26}} ''(CSS levels 3 and 4 are developed as independent modules, indexed at that page.)'' {{refend}} ==External links== {{wikibooks | HyperText Markup Language | Tag List | all elements in HTML }} * HTML 4.01 (Dec 24, 1999): [http://www.w3.org/TR/html401/index/elements.html elements] and [http://www.w3.org/TR/html401/index/attributes.html attributes] * {{vanchor|HTML5}} (Oct 28, 2014): [http://www.w3.org/TR/html5/index.html elements and attributes] [[Category:HTML tags]] [[Category:Web 1.0]]
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)
Pages transcluded onto the current version of this page
(
help
)
:
Template:Anchor
(
edit
)
Template:Citation
(
edit
)
Template:Citation needed
(
edit
)
Template:Cite IETF
(
edit
)
Template:Cite web
(
edit
)
Template:Clear
(
edit
)
Template:Code
(
edit
)
Template:Colon
(
edit
)
Template:Defn
(
edit
)
Template:Em
(
edit
)
Template:For
(
edit
)
Template:Glossary
(
edit
)
Template:Glossary end
(
edit
)
Template:Html series
(
edit
)
Template:Image frame
(
edit
)
Template:Main
(
edit
)
Template:Quote
(
edit
)
Template:Quote box
(
edit
)
Template:Redirect
(
edit
)
Template:Refbegin
(
edit
)
Template:Refend
(
edit
)
Template:Reflist
(
edit
)
Template:Refn
(
edit
)
Template:Short description
(
edit
)
Template:Tag
(
edit
)
Template:Term
(
edit
)
Template:Update section
(
edit
)
Template:Use American English
(
edit
)
Template:Vague
(
edit
)
Template:Vanchor
(
edit
)
Template:Var
(
edit
)
Template:Which
(
edit
)
Template:Wikibooks
(
edit
)