Content deleted Content added
updating rfcs
decap
Line 27:
}}
{{HTML}}
 
'''HyperText Markup Language''' ('''HTML''') is the standard [[markup language]] for documents designed to be displayed in a [[web browser]]. It defines the content and structure of [[web content]]. It is often assisted by technologies such as [[CSS|Cascading Style Sheets]] (CSS) and [[scripting language]]s such as [[JavaScript]].
 
Line 35 ⟶ 36:
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.
 
== History ==
 
=== Development ===
[[File:Tim Berners-Lee April 2009.jpg|thumb|right|upright|alt=Photograph of Tim Berners-Lee in April 2009|[[Tim Berners-Lee]] in April 2009]]
 
Line 52 ⟶ 53:
Further development under the auspices of the IETF was stalled by competing interests. {{As of|1996|since=y|post=,}} the HTML specifications have been maintained, with input from commercial software vendors, by the [[World Wide Web Consortium]] (W3C).<ref name="raggett">{{cite book|last=Raggett|first=Dave|url=https://www.w3.org/People/Raggett/book4/ch02.html|title=Raggett on HTML 4|year=1998|access-date=July 9, 2007|archive-url=https://web.archive.org/web/20070809234115/https://www.w3.org/People/Raggett/book4/ch02.html|archive-date=August 9, 2007}}</ref> In 2000, HTML became an international standard ([[International Organization for Standardization|ISO]]/[[International Electrotechnical Commission|IEC]] 15445:2000). HTML 4.01 was published in late 1999, with further errata published through 2001. In 2004, development began on HTML5 in the [[Web Hypertext Application Technology Working Group]] (WHATWG), which became a joint deliverable with the W3C in 2008, and was completed and standardized on 28 October 2014.<ref>{{cite web|title=HTML5 – Hypertext Markup Language – 5.0|url=https://www.w3.org/2014/10/html5-rec.html.en|date=28 October 2014|publisher=Internet Engineering Task Force|url-status=live|archive-url=https://web.archive.org/web/20141028233921/https://www.w3.org/2014/10/html5-rec.html.en|archive-date=October 28, 2014|access-date=November 25, 2014|quote=This document recommends HTML 5.0 after completion.}}</ref>
 
=== HTML version timeline ===
==== HTML 2 ====
:; November 24, 1995: HTML 2.0 was published as {{IETF RFC|1866}}. Supplemental [[Request for Comments|RFC]]s added capabilities:
::* November 25, 1995: {{IETF RFC|1867}} (form-based file upload)
Line 60 ⟶ 61:
::* January 1997: {{IETF RFC|2070}} ([[internationalization and localization|internationalization]])
 
==== HTML 3 ====
:; January 14, 1997: HTML 3.2<ref>{{cite web|url=https://www.w3.org/TR/REC-html32|title=HTML 3.2 Reference Specification |publisher=World Wide Web Consortium |date=January 14, 1997|access-date=November 16, 2008}}</ref> was published as a [[W3C Recommendation]]. It was the first version developed and standardized exclusively by the W3C, as the IETF had closed its HTML Working Group on September 12, 1996.<ref>{{cite web|url=https://www.w3.org/MarkUp/HTML-WG/|title=IETF HTML WG|access-date=June 16, 2007 |quote=Note: This working group is closed}}</ref>
:: Initially code-named "Wilbur",<ref name="engelfriet" /> HTML 3.2 dropped math formulas entirely, reconciled overlap among various proprietary extensions and adopted most of [[Netscape]]'s visual markup tags. Netscape's [[blink element]] and [[Microsoft]]'s [[marquee element]] were omitted due to a mutual agreement between the two companies.<ref name="raggett"/> A markup for mathematical formulas similar to that of HTML was standardized 14 months later in [[MathML]].
 
==== HTML 4 ====
:; December 18, 1997 : HTML 4.0<ref>{{cite web |url=https://www.w3.org/TR/REC-html40-971218/|title=HTML 4.0 Specification|publisher=World Wide Web Consortium|date=December 18, 1997|access-date=November 16, 2008}}</ref> was published as a W3C Recommendation. It offers three variations:
::;* : Strict, in which deprecated elements are forbidden
::;* Transitional, in which deprecated elements are allowed
::;* Frameset, in which mostly only [[Framing (World Wide Web)|frame]] related elements are allowed.
::;* Initially code-named "Cougar",<ref name="engelfriet">{{cite web|url=http://htmlhelp.com/reference/wilbur/intro.html|title=Introduction to Wilbur|first=Arnoud |last=Engelfriet|authorlink=Arnoud Engelfriet|website=htmlhelp.com|access-date=June 16, 2007}}</ref> HTML 4.0 adopted many browser-specific element types and attributes, but also sought to phase out Netscape's visual markup features by marking them as [[deprecation|deprecated]] in favor of style sheets. HTML 4 is an SGML application conforming to ISO 8879&nbsp;– SGML.<ref>{{cite web|url=https://www.w3.org/TR/html4/conform.html#h-4.2|title=HTML 4 – 4 Conformance: requirements and recommendations|access-date=December 30, 2009}}</ref>
:; April 24, 1998 : HTML 4.0<ref>{{cite web |url=https://www.w3.org/TR/1998/REC-html40-19980424/|title=HTML 4.0 Specification|publisher=World Wide Web Consortium|date=April 24, 1998|access-date=November 16, 2008}}</ref> was reissued with minor edits without incrementing the version number.
:; December 24, 1999 : HTML 4.01<ref>{{cite web |url=https://www.w3.org/TR/html401/|title=HTML 4.01 Specification|publisher=World Wide Web Consortium|date=December 24, 1999|access-date=November 16, 2008}}</ref> was published as a W3C Recommendation. It offers the same three variations as HTML 4.0 and its last errata<ref>{{cite web |title=HTML 4 Errata |url=https://www.w3.org/MarkUp/html4-updates/errata |publisher=W3C |access-date=March 2, 2023}}</ref> were published on May 12, 2001.
:; May 2000 : ISO/IEC 15445:2000<ref name="iso-html">{{cite web |url=https://www.iso.org/standard/27688.html |title= ISO/IEC 15445:2000 – Information technology – Document description and processing languages – HyperText Markup Language (HTML) |author=ISO |year=2000|access-date=March 1, 2023}}</ref> ("[[International Organization for Standardization|ISO]] HTML", based on HTML 4.01 Strict) was published as an ISO/IEC international standard.<ref>{{cite web |title=ISO/IEC 15445:2000(E) ISO-HTML |url=https://www.scss.tcd.ie/misc/15445/15445.HTML |website=www.scss.tcd.ie |publisher=ISO/IEC |access-date=March 1, 2023 |___location=Geneva, CH |language=EN |date=May 15, 2000}}</ref> In the ISO, this standard is in the ___domain of the [[ISO/IEC JTC 1/SC 34]] (ISO/IEC Joint Technical Committee 1, Subcommittee 34&nbsp;– Document description and processing languages).<ref name="iso-html" />
:; : After HTML 4.01, there were no new versions of HTML for many years, as the development of the parallel, XML-based language XHTML occupied the W3C's HTML Working Group.
 
==== HTML 5 ====
{{Main|HTML5}}
:; October 28, 2014 : HTML5<ref>{{cite web|url=https://www.w3.org/TR/2014/REC-html5-20141028/|title=HTML5: A vocabulary and associated APIs for HTML and XHTML|publisher=World Wide Web Consortium|date=28 October 2014|access-date=31 October 2014 }}</ref> was published as a W3C Recommendation.<ref>{{cite press release|url=https://www.w3.org/2014/10/html5-rec.html.en|title=Open Web Platform Milestone Achieved with HTML5 Recommendation|publisher=World Wide Web Consortium|date=28 October 2014|access-date=31 October 2014 }}</ref>
:; November 1, 2016 : HTML 5.1<ref>{{cite web|url=https://www.w3.org/TR/2016/REC-html51-20161101/|title=HTML 5.1|publisher=World Wide Web Consortium|date=1 November 2016|access-date=6 January 2017 }}</ref> was published as a W3C Recommendation.<ref>{{cite web|url=https://www.w3.org/blog/news/archives/5932|title=HTML 5.1 is a W3C Recommendation|publisher=World Wide Web Consortium |date=1 November 2016|access-date=6 January 2017 }}</ref><ref>{{cite web|url=https://www.w3.org/blog/2016/11/html-5-1-is-the-gold-standard/|title=HTML 5.1 is the gold standard|author=Philippe le Hegaret|publisher=World Wide Web Consortium|date=17 November 2016 |access-date=6 January 2017 }}</ref>
:; December 14, 2017 : HTML 5.2<ref>{{cite web|url=https://www.w3.org/TR/2017/REC-html52-20171214/|title=HTML 5.2|publisher=World Wide Web Consortium|date=14 December 2017|access-date=15 December 2017 }}</ref> was published as a W3C Recommendation.<ref>{{cite web|url=https://www.w3.org/blog/news/archives/6696|title=HTML 5.2 is now a W3C Recommendation|publisher=World Wide Web Consortium|date=14 December 2017|access-date=15 December 2017 }}</ref><ref>{{cite web|url=https://www.w3.org/blog/2017/12/html-5-2-is-done-html-5-3-is-coming/|title=HTML 5.2 is done, HTML 5.3 is coming|author=Charles McCathie Nevile|publisher=World Wide Web Consortium |date=14 December 2017|access-date=15 December 2017 }}</ref>
 
=== HTML draft version timeline ===
; October 1991 : ''HTML Tags'',<ref name="tagshtml" /> an informal CERN document listing 18 HTML tags, was first mentioned in public.
; June 1992 : First informal draft of the HTML DTD,<ref>{{cite web|last=Connolly|first=Daniel|title=MIME as a hypertext architecture |url=http://lists.w3.org/Archives/Public/www-talk/1992MayJun/0020.html|publisher=CERN|access-date=24 October 2010|author-link=Dan Connolly (computer scientist)|date=6 June 1992}}</ref> with seven subsequent revisions (July 15, August 6, August 18, November 17, November 19, November 20, November 22)<ref>{{cite web|last=Connolly|first=Daniel|title=HTML DTD enclosed|url=http://lists.w3.org/Archives/Public/www-talk/1992JulAug/0020.html|publisher=CERN|access-date=24 October 2010|author-link=Dan Connolly (computer scientist)|date=15 July 1992}}</ref><ref>{{cite web|last=Connolly|first=Daniel|title=document type declaration subset for Hyper Text Markup Language as defined by the World Wide Web project|url=http://lost-contact.mit.edu/afs/cern.ch/w3.org/www/Frame/fminit2.0/html.dtd|publisher=CERN|access-date=24 October 2010|author-link=Dan Connolly (computer scientist)|date=18 August 1992|archive-date=14 March 2012|archive-url=https://web.archive.org/web/20120314055308/http://lost-contact.mit.edu/afs/cern.ch/w3.org/www/Frame/fminit2.0/html.dtd|url-status=dead}}</ref><ref name="html11">{{cite web|last=Connolly|first=Daniel|title=Document Type Definition for the Hyper Text Markup Language as used by the World Wide Web application|url=http://lost-contact.mit.edu/afs/cern.ch/w3.org/www/MarkUp/Connolly/921125/archive.sh#html.dtd|publisher=CERN|access-date=24 October 2010|author-link=Dan Connolly (computer scientist)|date=24 November 1992|archive-date=18 January 2012|archive-url=https://web.archive.org/web/20120118155040/http://lost-contact.mit.edu/afs/cern.ch/w3.org/www/MarkUp/Connolly/921125/archive.sh#html.dtd|url-status=dead}} See section "Revision History"</ref>
; November 1992 : HTML DTD 1.1 (the first with a version number, based on RCS revisions, which start with 1.1 rather than 1.0), an informal draft<ref name="html11"/>
; June 1993 : Hypertext Markup Language<ref>{{cite web|last1=Berners-Lee|first1=Tim|title=Hyper Text Markup Language (HTML) Internet-Draft version 1.1|url=http://tools.ietf.org/html/draft-ietf-iiir-html-00|publisher=IETF IIIR Working Group|access-date=18 September 2010|author-link=Tim Berners-Lee|first2=Daniel|last2=Connolly|author-link2=Dan Connolly (computer scientist)|date=June 1993}}</ref> was published by the [[Internet Engineering Task Force|IETF]] IIIR Working Group as an Internet Draft (a rough proposal for a standard). It was replaced by a second version<ref name="ietfiiir">{{cite web|last1=Berners-Lee|first1=Tim|title=Hypertext Markup Language (HTML) Internet-Draft version 1.2|url=https://www.w3.org/MarkUp/draft-ietf-iiir-html-01.txt|publisher=IETF IIIR Working Group|access-date=18 September 2010|author-link=Tim Berners-Lee|first2=Daniel|last2=Connolly|author-link2=Dan Connolly (computer scientist)|date=June 1993}}</ref> one month later.
; November 1993: [https://www.w3.org/MarkUp/HTMLPlus/htmlplus_1.html HTML+] was published by the IETF as an Internet Draft and was a competing proposal to the Hypertext Markup Language draft. It expired in July 1994.<ref>{{Cite journal|url=https://datatracker.ietf.org/doc/draft-raggett-www-html/history/|title=History for draft-raggett-www-html-00|website=IETF Datatracker|access-date=2019-11-18|date=1993-11-08|last1=Raggett|first1=Dave}}</ref><!-- Forms and input tags introduced -->
; November 1994: First draft (revision 00) of HTML 2.0 published by IETF itself<ref>{{cite journal |last1=Berners-Lee|first1=Tim|title=HyperText Markup Language Specification – 2.0 INTERNET DRAFT|url=http://tools.ietf.org/html/draft-ietf-html-spec-00|website=Internet Engineering Task Force |access-date=24 October 2010|author-link=Tim Berners-Lee|first2=Daniel|last2=Connolly|author-link2=Dan Connolly (computer scientist)|date=28 November 1994}}</ref> (called as "HTML 2.0" from revision 02<ref>{{Cite journal|url=https://tools.ietf.org/html/draft-ietf-html-spec-02#section-1.1|title=Hypertext Markup Language - 2.0|last=Connolly |first=Daniel W.|website=tools.ietf.org|language=en|access-date=2019-11-18|date=1995-05-16}}</ref>), that finally led to the publication of {{IETF RFC|1866}} in November 1995.{{Ref RFC|1866}}
; April 1995 (authored March 1995) : HTML 3.0<ref>{{cite web|url=https://www.w3.org/MarkUp/html3/|title=HTML 3.0 Draft (Expired!) Materials|publisher=World Wide Web Consortium|date=December 21, 1995|access-date=November 16, 2008}}</ref> was proposed as a standard to the IETF, but the proposal expired five months later (28 September 1995)<ref name=html30cover /> without further action. It included many of the capabilities that were in Raggett's HTML+ proposal, such as support for tables, text flow around figures, and the display of complex mathematical formulas.<ref name=html30cover>{{cite web|url=https://www.w3.org/MarkUp/html3/CoverPage|title=HyperText Markup Language Specification Version 3.0|access-date=June 16, 2007}}</ref>
; : W3C began development of its own [[Arena (web browser)|Arena browser]] as a [[test bed]] for HTML 3 and Cascading Style Sheets,<ref>{{cite web|url=https://www.w3.org/People/Raggett/html3/html3.txt|title=HyperText Markup Language Specification Version 3.0|last=Raggett|first=Dave|date=28 March 1995|website=HTML 3.0 Internet Draft Expires in six months|publisher=[[World Wide Web Consortium]]|access-date=17 June 2010}}</ref><ref>{{cite book |last1=Bowers |first1=N. |chapter=Weblint: just another perl hack |chapter-url=https://www.usenix.org/publications/library/proceedings/usenix98/freenix/bowers.pdf |title=1998 USENIX Annual Technical Conference (USENIX ATC 98) |date=1998 }}</ref><ref>{{cite book|author-link=Håkon Wium Lie|first1=Håkon Wium|last1=Lie|last2=Bos|first2=Bert|author-link2=Bert Bos|title=Cascading style sheets: designing for the Web|url=https://archive.org/details/cascadingstylesh00lieh|url-access=registration|access-date=9 June 2010|date=April 1997|publisher=Addison Wesley Longman|page=[https://archive.org/details/cascadingstylesh00lieh/page/263 263]|isbn=9780201419986}}</ref> but HTML 3.0 did not succeed for several reasons. The draft was considered very large at 150 pages and the pace of browser development, as well as the number of interested parties, had outstripped the resources of the IETF.<ref name="raggett" /> Browser vendors, including Microsoft and Netscape at the time, chose to implement different subsets of HTML 3's draft features as well as to introduce their own extensions to it.<ref name="raggett" /> (See [[browser wars]].) These included extensions to control stylistic aspects of documents, contrary to the "belief [of the academic engineering community] that such things as text color, background texture, font size, and font face were definitely outside the scope of a language when their only intent was to specify how a document would be organized."<ref name="raggett" /> Dave Raggett, who has been a W3C Fellow for many years, has commented for example: "To a certain extent, Microsoft built its business on the Web by extending HTML features."<ref name="raggett" />
[[File:HTML5-logo.svg|thumb|right|upright|alt=Official HTML5 logo|Logo of HTML5]]
; January 2008 : [[HTML5]] was published as a [[World Wide Web Consortium#Certification|Working Draft]] by the W3C.<ref>{{cite web |url=https://www.w3.org/TR/html5/|title=HTML5|publisher=World Wide Web Consortium|date=June 10, 2008|access-date=November 16, 2008}}</ref>
; : Although its syntax closely resembles that of [[SGML]], [[HTML5]] has abandoned any attempt to be an SGML application and has explicitly defined its own "html" serialization, in addition to an alternative XML-based XHTML5 serialization.<ref>{{cite web|url=https://www.w3.org/blog/2008/01/html5-is-html-and-xml/|title=HTML5, one vocabulary, two serializations|date=15 January 2008 |access-date=February 25, 2009}}</ref>
; 2011&nbsp;HTML5 – Last Call :
; : On 14 February 2011, the W3C extended the charter of its HTML Working Group with clear milestones for HTML5. In May 2011, the working group advanced HTML5 to "Last Call", an invitation to communities inside and outside W3C to confirm the technical soundness of the specification. The W3C developed a comprehensive test suite to achieve broad interoperability for the full specification by 2014, which was the target date for recommendation.<ref name="w3c2014">{{cite web|url=https://www.w3.org/2011/02/htmlwg-pr.html|title=W3C Confirms May 2011 for HTML5 Last Call, Targets 2014 for HTML5 Standard|publisher=[[World Wide Web Consortium]]|access-date=18 February 2011|date=14 February 2011}}</ref> In January 2011, the WHATWG renamed its "HTML5" living standard to "HTML". The W3C nevertheless continues its project to release HTML5.<ref>{{cite web|url=http://blog.whatwg.org/html-is-the-new-html5|title=HTML Is the New HTML5|author=Hickson, Ian |website=The WHATWG Blog |date=January 19, 2011 |access-date=21 January 2011|archive-date=6 October 2019|archive-url=https://web.archive.org/web/20191006023430/https://blog.whatwg.org/html-is-the-new-html5}}</ref>
; 2012&nbsp;HTML5 – Candidate Recommendation :
; : In July 2012, WHATWG and [[W3C]] decided on a degree of separation. W3C will continue the HTML5 specification work, focusing on a single definitive standard, which is considered a "snapshot" by WHATWG. The WHATWG organization will continue its work with HTML5 as a "Living Standard". The concept of a living standard is that it is never complete and is always being updated and improved. New features can be added but functionality will not be removed.<ref>{{cite web|url=http://www.netmagazine.com/news/html5-gets-splits-122102|title=HTML5 gets the splits|publisher=Net magazine |first1=Craig |last1=Grannell |date=July 23, 2012 |access-date=23 July 2012 |archive-url=https://web.archive.org/web/20120725214739/http://www.netmagazine.com/news/html5-gets-splits-122102 |url-status=dead |archive-date=Jul 25, 2012 }}</ref>
; :In December 2012, W3C designated HTML5 as a Candidate Recommendation.<ref>{{cite web|url=https://www.w3.org/TR/2012/CR-html5-20121217/|title=HTML5|publisher=W3C|date=2012-12-17|access-date=2013-06-15}}</ref> The criterion for advancement to [[W3C recommendation#W3C recommendation (REC)|W3C Recommendation]] is "two 100% complete and fully interoperable implementations".<ref name="W3Crec">{{cite web|url=http://wiki.whatwg.org/wiki/FAQ#What.27s_this_I_hear_about_2022.3F|title=When Will HTML5 Be Finished?|website=FAQ|publisher=WHAT Working Group|access-date=29 November 2009}}</ref>
; 2014&nbsp;HTML5 – Proposed Recommendation and Recommendation :
; : In September 2014, W3C moved HTML5 to Proposed Recommendation.<ref>{{cite web|url=https://www.w3.org/blog/news/archives/4074|title=Call for Review: HTML5 Proposed Recommendation Published W3C News|publisher=W3C|date=2014-09-16|access-date=2014-09-27}}</ref>
; : On 28 October 2014, HTML5 was released as a stable W3C Recommendation,<ref>{{cite web|url=https://www.w3.org/2014/10/html5-rec.html.en|title=Open Web Platform Milestone Achieved with HTML5 Recommendation|publisher=W3C|date=28 October 2014|access-date=29 October 2014}}</ref> meaning the specification process is complete.<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|website=Ars Technica|date=2014-10-29|access-date=2014-10-29}}</ref>
 
==== XHTML versions ====
{{Main|XHTML}}
XHTML is a separate language that began as a reformulation of HTML 4.01 using [[XML]] 1.0. It is now referred to as ''the XML syntax for HTML'' and is no longer being developed as a separate standard.<ref>{{cite web |title=HTML vs XML syntax |url=https://html.spec.whatwg.org/multipage/introduction.html#html-vs-xhtml |publisher=WHATWG |access-date=22 March 2023}}</ref>
Line 109 ⟶ 110:
* XHTML 2.0 was a working draft. Work on it was abandoned in 2009 in favor of work on [[HTML5]] and [[XHTML#XHTML5|XHTML5]].<ref>{{cite web |url=https://www.w3.org/TR/xhtml2/|title=XHTM 2.0|publisher=World Wide Web Consortium|date=July 26, 2006|access-date=November 16, 2008}}</ref><ref>{{cite web |url=https://www.w3.org/News/2009#item119|title=XHTML 2 Working Group Expected to Stop Work End of 2009, W3C to Increase Resources on HTML5|publisher=World Wide Web Consortium|date=July 17, 2009|access-date=November 16, 2008}}</ref><ref>{{cite web|title=W3C XHTML FAQ|url=https://www.w3.org/2009/06/xhtml-faq.html}}</ref> XHTML 2.0 was incompatible with XHTML 1.x and, therefore, would be more accurately characterized as an XHTML-inspired new language than an update to XHTML 1.x.
 
=== Transition of HTML Publicationpublication to WHATWG ===
{{See also|HTML5#W3C and WHATWG conflict}}
On 28 May 2019, the W3C announced that WHATWG would be the sole publisher of the HTML and DOM standards.<ref name="W3C transfer blog">{{cite web|url=https://www.w3.org/blog/2019/05/w3c-and-whatwg-to-work-together-to-advance-the-open-web-platform/|title=W3C and WHATWG to Work Together to Advance the Open Web Platform|last1=Jaffe|first1=Jeff|date=28 May 2019|website=W3C Blog|archive-url=https://web.archive.org/web/20190529021122/https://www.w3.org/blog/2019/05/w3c-and-whatwg-to-work-together-to-advance-the-open-web-platform/|archive-date=29 May 2019|url-status=live|access-date=29 May 2019}}</ref><ref name="W3C transfer HTML">{{cite web|url=https://www.w3.org/html/|title=W3C and the WHATWG Signed an Agreement to Collaborate on a Single Version of HTML and DOM|date=28 May 2019|website=W3C|archive-url=https://web.archive.org/web/20190529012655/https://www.w3.org/html/|archive-date=29 May 2019|url-status=live|access-date=29 May 2019}}</ref><ref name="W3C transfer memo">{{cite web|url=https://www.w3.org/2019/04/WHATWG-W3C-MOU.html|title=Memorandum of Understanding Between W3C and WHATWG|date=28 May 2019|website=W3C|archive-url=https://web.archive.org/web/20190529012854/https://www.w3.org/2019/04/WHATWG-W3C-MOU.html|archive-date=29 May 2019|url-status=live|access-date=29 May 2019}}</ref><ref name="W3C transfer ZDNet">{{cite news |last1=Cimpanu |first1=Catalin |title=Browser vendors Win War with W3C over HTML and DOM standards |url=https://www.zdnet.com/article/browser-vendors-win-war-with-w3c-over-html-and-dom-standards/ |access-date=29 May 2019 |work=ZDNet |date=29 May 2019 |archive-url=https://web.archive.org/web/20190529021959/https://www.zdnet.com/article/browser-vendors-win-war-with-w3c-over-html-and-dom-standards/ |archive-date=29 May 2019}}</ref> The W3C and WHATWG had been publishing competing standards since 2012. While the W3C standard was identical to the WHATWG in 2007 the standards have since progressively diverged due to different design decisions.<ref name="W3C forks">{{cite web |title=W3C - WHATWG Wiki |url=https://wiki.whatwg.org/wiki/W3C |website=WHATWG Wiki |access-date=29 May 2019 |archive-url=https://web.archive.org/web/20190529013834/https://wiki.whatwg.org/wiki/W3C |archive-date=29 May 2019}}</ref> The WHATWG "Living Standard" had been the de facto web standard for some time.<ref>{{cite web
Line 120 ⟶ 121:
}}</ref>
 
== Markup ==
HTML markup consists of several key components, including those called ''tags'' (and their ''attributes''), character-based ''data types'', ''character references'' and ''entity references''. HTML tags most commonly come in pairs like {{code|lang=html|code=<h1>}} and {{code|lang=html|code=</h1>}}, although some represent ''empty elements'' and so are unpaired, for example {{code|lang=html|code=<img>}}. The first tag in such a pair is the ''start tag'', and the second is the ''end tag'' (they are also called ''opening tags'' and ''closing tags'').
 
Line 139 ⟶ 140:
</html>
</syntaxhighlight>
The text between {{code|lang=html|code=<html>}} and {{code|lang=html|code=</html>}} describes the web page, and the text between {{code|lang=html|code=<body>}} and {{code|lang=html|code=</body>}} is the visible page content. The markup text {{code|lang=html|code=<title>This is a title</title>}} defines the browser page title shown on [[browser tab]]s and [[Window (computing)|window]] titles and the tag {{code | lang=html | code=<div>}} defines a division of the page used for easy styling. Between {{Codecode|<head>|HTML}} and {{Codecode|</head>|HTML}}, a {{Codecode|<meta>|HTML}} element can be used to define webpage metadata.
 
The Document Type Declaration {{code|lang=html|code=<!DOCTYPE html>}} is for HTML5. If a declaration is not included, various browsers will revert to "[[quirks mode]]" for rendering.<ref name="hsivonen">[http://hsivonen.iki.fi/doctype/ Activating Browser Modes with Doctype]. Hsivonen.iki.fi. Retrieved on 2012-02-16.</ref>
 
=== Elements ===
{{Main|HTML element}}
[[File:HTML element content categories.svg|thumb|HTML element content categories]]
Line 163 ⟶ 164:
If attributes are not mentioned, default values are used in each case.
 
==== Element examples ====
{{See also|HTML element}}
 
Line 194 ⟶ 195:
</blockquote>
 
CSS can drasticallysubstantially change the rendering.
Paragraphs:<syntaxhighlight lang="html"><p>Paragraph 1</p> <p>Paragraph 2</p></syntaxhighlight>
 
===== 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 {{Codecode|code=<br>|lang=html}} is an ''empty element'' in that, although it may have attributes, it can take no content and it may not have an end tag.
<syntaxhighlight lang="html"><p>This <br> is a paragraph <br> with <br> line breaks</p></syntaxhighlight>
This is a link in HTML. To create a link the {{code|lang=html|code=<a>}} tag is used. The <code>href</code> attribute holds the [[URL]] address of the link.
<syntaxhighlight lang="html"><a href="https://www.wikipedia.org/">A link to Wikipedia!</a></syntaxhighlight>
 
===== Inputs =====
There are many possible ways a user can give input/s like:<syntaxhighlight lang="html">
<input type="text"> <!-- This is for text input -->
Line 214 ⟶ 215:
 
There are several types of markup elements used in HTML:
; Structural markup indicates the purpose of text : For example, {{code|lang=html|code=<h2>Golf</h2>}} establishes "Golf" as a second-level [[HTML element#Basic text|heading]]. Structural markup does not denote any specific rendering, but most web browsers have default styles for element formatting. Content may be further styled using [[Cascading Style Sheets]] (CSS).<ref>{{cite web|title=CSS Introduction|url=https://www.w3schools.com/css/css_intro.asp|publisher=W3schools|access-date=16 March 2015}}</ref>
; Presentational markup indicates the appearance of the text, regardless of its purpose : For example, {{code|lang=html|code=<b>bold text</b>}} indicates that visual output devices should render "boldface" in bold text, but gives a little indication what devices that are unable to do this (such as aural devices that read the text aloud) should do. In the case of both {{code|lang=html|code=<b>bold text</b>}} and {{code|lang=html|code=<i>italic text</i>}}, there are other elements that may have equivalent visual renderings but that are more semantic in nature, such as {{code|lang=html|code=<strong>strong text</strong>}} and {{code|lang=html|code=<em>emphasized text</em>}} respectively. It is easier to see how an aural user agent should interpret the latter two elements. However, they are not equivalent to their presentational counterparts: it would be undesirable for a screen reader to emphasize the name of a book, for instance, but on a screen, such a name would be italicized. Most presentational markup elements have become [[Deprecation|deprecated]] under the HTML 4.0 specification in favor of using [[CSS]] for styling.
; Hypertext markup makes parts of a document into links to other documents : An anchor element creates a [[hyperlink]] in the document and its <code>href</code> attribute sets the link's target [[URL]]. For example, the HTML markup {{code|lang=html|code=<a href="https://en.wikipedia.org/">Wikipedia</a>}}, will render the word "<span class="plainlinks">[https://en.wikipedia.org/ Wikipedia]</span>" as a hyperlink. To render an image as a hyperlink, an <code>img</code> element is inserted as content into the <code>a</code> element. Like <code>br</code>, <code>img</code> is an empty element with attributes but no content or closing tag. {{code|lang=html|code=<a href="https://example.org"><img src="image.gif" alt="descriptive text" width="50" height="50" border="0"></a>}}.
 
==== Attributes ====
{{Main|HTML attribute}}
Most of the attributes of an element are [[name–value pair]]s, separated by <code>&#61;</code> and written within the start tag of an element after the element's name. The value may be enclosed in single or double quotes, although values consisting of certain characters can be left unquoted in HTML (but not XHTML).<ref>{{cite web |url=https://www.w3.org/TR/html401/intro/sgmltut.html#h-3.2.2|title=On SGML and HTML|publisher=World Wide Web Consortium|access-date=November 16, 2008}}</ref><ref>{{cite web |url=https://www.w3.org/TR/xhtml1/diffs.html#h-4.4|title=XHTML 1.0 – Differences with HTML&nbsp;4|publisher=World Wide Web Consortium|access-date=November 16, 2008}}</ref> Leaving attribute values unquoted is considered unsafe.<ref>{{cite web|first=Jukka|last=Korpela|url=https://jkorpela.fi/qattr.html|title=Why attribute values should always be quoted in HTML|publisher=Cs.tut.fi|date=July 6, 1998|access-date=November 16, 2008}}</ref> In contrast with name-value pair attributes, there are some attributes that affect the element simply by their presence in the start tag of the element,<ref name="tagshtml">{{cite web|title=Tags used in HTML|url=https://www.w3.org/History/19921103-hypertext/hypertext/WWW/MarkUp/Tags.html|date=November 3, 1992|publisher=World Wide Web Consortium|url-status=live|archive-url=https://web.archive.org/web/20100131184344/http://www.w3.org/History/19921103-hypertext/hypertext/WWW/MarkUp/Tags.html|archive-date=January 31, 2010|access-date=November 16, 2008}}</ref> like the <code>ismap</code> attribute for the <code>img</code> element.<ref>{{cite web|url=https://www.w3.org/TR/1999/REC-html401-19991224/struct/objects.html#adef-ismap|title=Objects, Images, and Applets in HTML documents|publisher=World Wide Web Consortium|date=December 24, 1999|access-date=November 16, 2008}}</ref>
 
There are several common attributes that may appear in many elements :
 
* The <code>id</code> attribute provides a document-wide unique identifier for an element. This is used to identify the element so that stylesheets can alter its presentational properties, and scripts may alter, animate or delete its contents or presentation. Appended to the URL of the page, it provides a globally unique identifier for the element, typically a sub-section of the page. For example, the ID "Attributes" in <code><nowiki>https://en.wikipedia.org/wiki/HTML#Attributes</nowiki></code>.
* The <code>class</code> attribute provides a way of classifying similar elements. This can be used for [[semantics|semantic]] or presentation purposes. For example, an HTML document might semantically use the designation {{code|lang=html|code=<class="notation">}} to indicate that all elements with this class value are subordinate to the main text of the document. In presentation<!-- Presentationally is not a formally accepted word -->, such elements might be gathered together and presented as footnotes on a page instead of appearing in the place where they occur in the HTML source. Class attributes are used semantically in [[microformat]]s. Multiple class values may be specified; for example {{code|lang=html|code=<class="notation important">}} puts the element into both the <code>notation</code> and the <code>important</code> classes.
Line 238:
Most elements take the language-related attribute <code>dir</code> to specify text direction, such as with "rtl" for right-to-left text in, for example, [[Arabic language|Arabic]], [[Persian language|Persian]] or [[Hebrew language|Hebrew]].<ref>{{cite web|title=H56: Using the dir attribute on an inline element to resolve problems with nested directional runs|url=https://www.w3.org/TR/WCAG-TECHS/H56.html|website=Techniques for WCAG 2.0|publisher=W3C|access-date=18 September 2010}}</ref>
 
=== Character and entity references ===
{{See also|List of XML and HTML character entity references|Unicode and HTML}}
 
Line 364:
In addition, HTML 4.01 provides Transitional and Frameset DTDs, [[#Transitional versus strict|as explained below]]. The transitional type is the most inclusive, incorporating current tags as well as older or "deprecated" tags, with the Strict DTD excluding deprecated tags. The frameset has all tags necessary to make frames on a page along with the tags included in transitional type.<ref>{{Cite web|title=HTML 4 Frameset Document Type Definition|url=https://www.w3.org/TR/html401/sgml/framesetdtd.html|access-date=2021-12-25|website=W3C}}</ref>
 
== Semantic HTML ==
{{Main|Semantic HTML}}
Semantic HTML is a way of writing HTML that emphasizes the meaning of the encoded information over its presentation (look). HTML has included semantic markup from its inception,<ref>{{cite book|last1=Berners-Lee|first1=Tim|last2=Fischetti|first2=Mark|title=Weaving the Web: The Original Design and Ultimate Destiny of the World Wide Web by Its Inventor|url=https://archive.org/details/weavingweborigin00bern_0|url-access=registration|isbn=978-0-06-251587-2|publisher=Harper|___location=San Francisco|year=2000}}</ref> but has also included presentational markup, such as {{code|lang=html|code=<font>}}, {{code|lang=html|code=<i>}} and {{code|lang=html|code=<center>}} tags. There are also the semantically neutral [[div and span]] tags. Since the late 1990s, when [[Cascading Style Sheets]] were beginning to work in most browsers, web authors have been encouraged to avoid the use of presentational HTML markup with a view to the [[separation of content and presentation]].<ref>{{cite web|url=https://www.w3.org/MarkUp/Guide/Style.html|title=Adding a touch of style|last=Raggett|first=Dave|year=2002|publisher=W3C|access-date=October 2, 2009}} This article notes that presentational HTML markup may be useful when targeting browsers "before Netscape 4.0 and Internet Explorer 4.0". See the [[list of web browsers]] to confirm that these were both released in 1997.</ref>
Line 378:
Good semantic HTML also improves the [[accessibility]] of web documents (see also [[Web Content Accessibility Guidelines]]). For example, when a screen reader or audio browser can correctly ascertain the structure of a document, it will not waste the visually impaired user's time by reading out repeated or irrelevant information when it has been marked up correctly.
 
== Delivery ==
HTML documents can be delivered by the same means as any other computer file. However, they are most often delivered either by [[Hypertext Transfer Protocol|HTTP]] from a [[web server]] or by [[email]].
 
=== HTTP ===
{{Main|Hypertext Transfer Protocol}}
The [[World Wide Web]] is composed primarily of HTML documents transmitted from web servers to web browsers using the [[Hypertext Transfer Protocol]] (HTTP). However, HTTP is used to serve images, sound, and other content, in addition to HTML. To allow the web browser to know how to handle each document it receives, other information is transmitted along with the document. This [[meta data]] usually includes the [[MIME type]] (e.g., <kbd>text/html</kbd> or <kbd>application/xhtml+xml</kbd>) and the character encoding (see [[Character encodings in HTML]]).
Line 389:
The W3C recommendations state that XHTML 1.0 documents that follow guidelines set forth in the recommendation's Appendix C may be labeled with either MIME Type.<ref>{{cite web|url=https://www.w3.org/TR/xhtml1/#media|title=XHTML 1.0 The Extensible HyperText Markup Language (Second Edition)|publisher=World Wide Web Consortium|orig-date=2000|year=2002|access-date=December 7, 2008|quote=XHTML Documents which follow the guidelines set forth in Appendix C, "HTML Compatibility Guidelines" may be labeled with the Internet Media Type "text/html" [RFC2854], as they are compatible with most HTML browsers. Those documents, and any other document conforming to this specification, may also be labeled with the Internet Media Type "application/xhtml+xml" as defined in [RFC3236].}}</ref> XHTML 1.1 also states that XHTML 1.1 documents should{{Ref RFC|2119|quote=3. SHOULD This word, or the adjective "RECOMMENDED", mean that there may exist valid reasons in particular circumstances to ignore a particular item, but the full implications must be understood and carefully weighed before choosing a different course. }} be labeled with either MIME type.<ref>{{cite web|url=https://www.w3.org/TR/xhtml11/conformance.html#strict|title=XHTML 1.1 – Module-based XHTML&nbsp;— Second Edition|publisher=World Wide Web Consortium|year=2007|access-date=December 7, 2008|quote=XHTML 1.1 documents SHOULD be labeled with the Internet Media Type text/html as defined in [RFC2854] or application/xhtml+xml as defined in [RFC3236].}}</ref>
 
=== HTML e-mail ===
{{Main|HTML email}}
Most graphical email clients allow the use of a subset of HTML (often ill-defined) to provide formatting and [[semantic web|semantic]] markup not available with [[plain text]]. This may include typographic information like colored headings, emphasized and quoted text, inline images and diagrams. Many such clients include both a [[Graphical user interface|GUI]] editor for composing HTML e-mail messages and a rendering engine for displaying them. Use of HTML in e-mail is criticized by some because of compatibility issues, because it can help disguise [[phishing]] attacks, because of accessibility issues for blind or visually impaired people, because it can confuse [[Email spam|spam]] filters and because the message size is larger than plain text.
 
=== Naming conventions ===
The most common [[filename extension]] for [[computer file|files]] containing HTML is <kbd>.html</kbd>. A common abbreviation of this is <kbd>.htm</kbd>, which originated because some early operating systems and file systems, such as [[DOS]] and the limitations imposed by [[File Allocation Table|FAT]] data structure, limited file extensions to [[8.3 filename|three letters]].<ref>{{cite web|title=Naming Files, Paths, and Namespaces|url=https://msdn.microsoft.com/en-us/library/windows/desktop/aa365247%28v=vs.85%29.aspx?f=255&MSPPError=-2147217396|publisher=Microsoft|access-date=16 March 2015}}</ref>
 
=== HTML Application ===
{{Main|HTML Application}}
An HTML Application (HTA; file extension <kbd>.hta</kbd>) is a [[Microsoft Windows]] application that uses HTML and Dynamic HTML in a [[Web browser|browser]] to provide the application's graphical interface. A regular HTML file is confined to the security model of the [[Browser security|web browser's security]], communicating only to web servers and manipulating only web page objects and [[HTTP cookie|site cookies]]. An HTA runs as a fully trusted application and therefore has more privileges, like creation/editing/removal of files and [[Windows Registry]] entries. Because they operate outside the browser's security model, HTAs cannot be executed via HTTP, but must be downloaded (just like an [[EXE|EXE file]]) and executed from local file system.
 
== HTML4 variations ==
Since its inception, HTML and its associated protocols gained acceptance relatively quickly. However, no clear standards existed in the early years of the language. Though its creators originally conceived of HTML as a semantic language devoid of presentation details,<ref>[https://www.w3.org/History/19921103-hypertext/hypertext/WWW/MarkUp/HTMLConstraints.html HTML Design Constraints], W3C Archives</ref> practical uses pushed many presentational elements and attributes into the language, driven largely by the various browser vendors. The latest standards surrounding HTML reflect efforts to overcome the sometimes chaotic development of the language<ref>[http://ei.cs.vt.edu/~wwwbtb/book/chap13/who.html WWW: BTB – HTML], Pris Sears</ref> and to create a rational foundation for building both meaningful and well-presented documents. To return HTML to its role as a semantic language, the [[World Wide Web Consortium|W3C]] has developed style languages such as [[Cascading Style Sheets|CSS]] and [[XSL]] to shoulder the burden of presentation. In conjunction, the HTML specification has slowly reined in the presentational elements.
 
There are two axes differentiating various variations of HTML as currently specified: SGML-based HTML versus XML-based HTML (referred to as XHTML) on one axis, and strict versus transitional (loose) versus frameset on the other axis.
 
=== SGML-based versus XML-based HTML ===
One difference in the latest{{when|date=March 2022}} HTML specifications lies in the distinction between the SGML-based specification and the XML-based specification. The XML-based specification is usually called [[XHTML]] to distinguish it clearly from the more traditional definition. However, the root element name continues to be "html" even in the XHTML-specified HTML. The W3C intended XHTML 1.0 to be identical to HTML 4.01 except where limitations of XML over the more complex SGML require workarounds. Because XHTML and HTML are closely related, they are sometimes documented in parallel. In such circumstances, some authors [[(X)HTML|conflate the two names]] as (X)HTML or X(HTML).
 
Line 433:
By carefully following the W3C's compatibility guidelines, a user agent should be able to interpret the document equally as HTML or XHTML. For documents that are XHTML 1.0 and have been made compatible in this way, the W3C permits them to be served either as HTML (with a <code>text/html</code> [[MIME type]]), or as XHTML (with an <code>application/xhtml+xml</code> or <code>application/xml</code> MIME type). When delivered as XHTML, browsers should use an XML parser, which adheres strictly to the XML specifications for parsing the document's contents.
 
=== Transitional versus strict ===
HTML 4 defined three different versions of the language: Strict, Transitional (once called Loose), and Frameset. The Strict version is intended for new documents and is considered best practice, while the Transitional and Frameset versions were developed to make it easier to transition documents that conformed to older HTML specifications or did not conform to any specification to a version of HTML 4. The Transitional and Frameset versions allow for presentational markup, which is omitted in the Strict version. Instead, [[cascading style sheets]] are encouraged to improve the presentation of HTML documents. Because XHTML 1 only defines an XML syntax for the language defined by HTML 4, the same differences apply to XHTML 1 as well.
 
Line 472:
The Frameset version includes everything in the Transitional version, as well as the <code>frameset</code> element (used instead of <code>body</code>) and the <code>frame</code> element.
 
=== Frameset versus transitional ===
In addition to the above transitional differences, the frameset specifications (whether XHTML 1.0 or HTML 4.01) specify a different content model, with <code>frameset</code> replacing <code>body</code>, that contains either <code>frame</code> elements, or optionally <code>noframes</code> with a <code>body</code>.
 
=== Summary of specification versions ===
As this list demonstrates, the loose versions of the specification are maintained for legacy support. However, contrary to popular misconceptions, the move to XHTML does not imply a removal of this legacy support. Rather the X in XML stands for extensible and the W3C is modularizing the entire specification and opens it up to independent extensions. The primary achievement in the move from XHTML 1.0 to XHTML 1.1 is the modularization of the entire specification. The strict version of HTML is deployed in XHTML 1.1 through a set of modular extensions to the base XHTML 1.1 specification. Likewise, someone looking for the loose (transitional) or frameset specifications will find similar extended XHTML 1.1 support (much of it is contained in the legacy or frame modules). Modularization also allows for separate features to develop on their own timetable. So for example, XHTML 1.1 will allow quicker migration to emerging XML standards such as [[MathML]] (a presentational and semantic math language based on XML) and [[XForms]]—a new highly advanced web-form technology to replace the existing HTML forms.
 
In summary, the HTML 4 specification primarily reined in all the various HTML implementations into a single clearly written specification based on SGML. XHTML 1.0, ported this specification, as is, to the new XML-defined specification. Next, XHTML 1.1 takes advantage of the extensible nature of XML and modularizes the whole specification. XHTML 2.0 was intended to be the first step in adding new features to the specification in a standards-body-based approach.
 
== WHATWG HTML versus HTML5 ==
{{Main|#Transition of HTML Publication to WHATWG}}
The HTML Living Standard, which is developed by WHATWG, is the official version, while W3C HTML5 is no longer separate from WHATWG.
 
== WYSIWYG editors ==
{{missing information|contenteditable|date=January 2021}}
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.
Line 491:
 
WYSIWYG editors remain a controversial topic because of their perceived flaws such as:
 
* Relying mainly on the layout as opposed to meaning, often using markup that does not convey the intended meaning but simply copies the layout.<ref>[http://xhtml.com/en/xhtml/reference/blockquote/ XHTML Reference: blockquote] {{Webarchive|url=https://web.archive.org/web/20100325160356/http://xhtml.com/en/xhtml/reference/blockquote/ |date=2010-03-25 }}. Xhtml.com. Retrieved on 2012-02-16.</ref>
* Often producing extremely verbose and redundant code that fails to make use of the cascading nature of HTML and [[CSS]].
Line 497 ⟶ 496:
* As a great deal of the information in HTML documents is not in the layout, the model has been criticized for its "what you see is all you get"-nature.<ref>[http://www.invisiblerevolution.net/ Doug Engelbart's INVISIBLE REVOLUTION]. Invisiblerevolution.net. Retrieved on 2012-02-16.</ref>
 
== See also ==
<!--PLEASE RESPECT ALPHABETICAL ORDER-->
{{div col|colwidth=20em}}
Line 516 ⟶ 515:
{{div col end}}
 
== References ==
{{reflist|30em}}
 
== External links ==
{{wikibooks}}
<!-- See discussion at [[Talk:HTML/Archive_3#Suggestion:_External_links_to_tutorials]] -->
{{sister project links|d=Q8811|c=category:HTML|b=HyperText Markup Language|v=HTML|n=no|q=no|s=no|wikt=HTML|m=Help:HTML in wikitext|mw=HTML restriction|species=no}}
* {{Curlie|Computers/Data_Formats/Markup_Languages/HTML/Reference/}}
* [[WHATWG]]'s [https://html.spec.whatwg.org/multipage/ HTML Living Standard]
* [https://www.w3.org/MarkUp/Guide/ Dave Raggett's Introduction to HTML]
* [https://web.archive.org/web/20110412130543/http://computemagazine.com/man-who-invented-world-wide-web-gives-new-definition Tim Berners-Lee Gives the Web a New Definition] (archived 12 April 2011)
* [https://meiert.com/en/indices/html-elements/ List of all HTML elements from all major versions]
* [https://www.w3schools.com/html/html_entities.asp HTML Entities]