Content deleted Content added
→HTML draft version timeline: Adjust tense: the W3C's project to release HTML 5 was concluded some time ago. |
m Replace em-dash with with en-dash. |
||
(14 intermediate revisions by 11 users not shown) | |||
Line 1:
{{Short description|
{{Redirect2|.htm|.html||HTM (disambiguation){{!}}HTM}}
{{pp-vandalism|small=yes}}
Line 27:
}}
{{HTML}}
'''Hypertext Markup Language''' ('''HTML''') is the standard [[markup language]]{{efn|Even though HTML can be run in a browser, it is not viewed as a [[programming language]] in programming language discourse.<ref>{{Cite book |author-link=Felienne Hermans|last1=Hermans |first1=Felienne |last2=Schlesinger |first2=Ari
[[Web browser]]s receive HTML documents from a [[web server]] or from local storage and [[browser engine|render]] the documents into multimedia web pages. HTML describes the structure of a [[web page]] [[Semantic Web|semantically]] and originally included cues for its appearance.
[[HTML element]]s are the building blocks of HTML pages. With HTML constructs, [[HTML element#Images and objects|images]] and other objects such as [[Fieldset|interactive forms]] may be embedded into the rendered page. HTML provides a means to create [[structured document]]s by denoting structural [[semantics]] for text such as headings, paragraphs, lists, [[Hyperlink|links]], quotes, and other items. HTML elements are delineated by ''tags'', written using [[Bracket#Angle brackets|angle brackets]]. Tags such as {{code|lang=html|code=<img>}} and {{code|lang=html|<input>}} directly introduce content into the page. Other tags such as {{code|lang=html|code=<p>}} and {{code|lang=html|code=</p>}} surround and provide information about document text and may include sub-element tags. [[Web browser|Browsers]] do not display the HTML tags, but use them to interpret the content of the page.
HTML can embed programs written in a [[scripting language]] such as [[JavaScript]], which affects the behavior and content of web pages. The inclusion of CSS defines the look and layout of content. The [[World Wide Web Consortium]] (W3C), former maintainer of the HTML and current maintainer of the CSS standards, has encouraged the use of [[CSS]] over explicit presentational HTML {{as of|1997|lc=y|since=y|post=.}}<ref name="deprecated">{{cite web|title=HTML 4.0 Specification — W3C Recommendation — Conformance: requirements and recommendations |url=https://www.w3.org/TR/REC-html40-971218/conform.html#deprecated|date=December 18, 1997|publisher=World Wide Web Consortium|url-status=live|archive-url=https://web.archive.org/web/20150705040855/http://www.w3.org/TR/REC-html40-971218/conform.html|archive-date=July 5, 2015|access-date=July 6, 2015}}</ref> A form of HTML, known as [[HTML5]], is used to display video and audio, primarily using the {{code|lang=html|<canvas>}} element, together with JavaScript.
Line 147:
{{Main|HTML element}}
[[File:HTML element content categories.svg|thumb|HTML element content categories]]
HTML documents imply a structure of nested [[HTML element]]s. These are indicated in the document by HTML ''tags'', enclosed in angle brackets
In the simple, general case, the extent of an element is indicated by a pair of tags: a "start tag" {{code|lang=html|code=<p>}} and "end tag" {{code|lang=html|code=</p>}}. The text content of the element, if any, is placed between these tags.
Line 161:
The general form of an HTML element is therefore: {{code|lang=html|code=<tag attribute1="value1" attribute2="value2">''content''</tag>}}. Some HTML elements are defined as ''empty elements'' and take the form {{code|lang=html|code=<tag attribute1="value1" attribute2="value2">}}. Empty elements may enclose no content, for instance, the {{code|lang=html|code=<br>}} tag or the inline {{code|lang=html|code=<img>}} tag.
The name of an HTML element is the name used in the tags.
The end tag's name is preceded by a slash character
==== Element examples ====
Line 200 ⟶ 199:
===== Line breaks =====
{{code|lang=html|code=<br>}}. The difference between {{code|lang=html|code=<br>}} and {{code|lang=html|code=<p>}} is that {{code|lang=html|code=<br>}} [[line breaking character|breaks a line]] without altering the semantic structure of the page, whereas {{code|lang=html|code=<p>}} sections the page into [[paragraph]]s. The element {{code|code=<br>|lang=html}} is an ''empty element'' in that, although it may have attributes, it can take no content and it
<syntaxhighlight lang="html"><p>This <br> is a paragraph <br> with <br> line breaks</p></syntaxhighlight>
Line 250 ⟶ 249:
Escaping also allows for characters that are not easily typed, or that are not available in the document's [[character encoding]], to be represented within the element and attribute content. For example, the acute-accented <code>e</code> (<code>é</code>), a character typically found only on Western European and South American keyboards, can be written in any HTML document as the entity reference <code>&eacute;</code> or as the numeric references <code>&#xE9;</code> or <code>&#233;</code>, using characters that are available on all keyboards and are supported in all character encodings. [[Unicode]] character encodings such as [[UTF-8]] are compatible with all modern browsers and allow direct access to almost all the characters of the world's writing systems.<ref>{{cite web|title=''The Unicode Standard'': A Technical Introduction |publisher=Unicode |url=https://www.unicode.org/standard/principles.html|access-date=2010-03-16}}</ref>
{| class="wikitable"
|+HTML escape sequence examples
!Named
!Decimal
Line 340 ⟶ 339:
=== Document type declaration ===
HTML documents are required to start with a
The original purpose of the doctype was to enable the parsing and validation of HTML documents by SGML tools based on the [[document type definition]] (DTD). The DTD to which the DOCTYPE refers contains a machine-readable grammar specifying the permitted and prohibited content for a document conforming to such a DTD. Browsers, on the other hand, do not implement HTML as an application of SGML and as consequence do not read the DTD.
Line 424 ⟶ 423:
* Use the empty-element syntax only for elements specified as empty in HTML.
* Remove the closing slash in empty-element tags: for example {{code|lang=html|code=<br>}} instead of {{code|lang=html|code=<br/>}}.
* Include explicit close tags for elements that permit content but are left empty (for example, {{code|lang=html|code=
* Omit the XML declaration.
Line 477 ⟶ 476:
== WHATWG HTML versus HTML5 ==
{{Main|#Transition of HTML
The HTML Living Standard, which is developed by WHATWG, is the official version, while W3C HTML5 is no longer separate from WHATWG.
Line 484 ⟶ 483:
There are some [[WYSIWYG]] editors (''what you see is what you get''), in which the user lays out everything as it is to appear in the HTML document using a [[graphical user interface]] (GUI), often similar to [[word processor]]s. The editor renders the document rather than showing the code, so authors do not require extensive knowledge of HTML.
The WYSIWYG editing model has been criticized,<ref>Sauer, C.: WYSIWIKI – Questioning WYSIWYG in the Internet Age. In: Wikimania (2006)</ref><ref>Spiesser, J., Kitchen, L.: Optimization of HTML automatically generated by WYSIWYG programs. In: 13th International Conference on World Wide Web, pp.
WYSIWYG editors remain a controversial topic because of their perceived flaws such as:
|