Markup HTML5 introduces
elements and
attributes that reflect typical usage on modern websites. Some of them are semantic replacements for common uses of generic block () and inline () elements, for example (website navigation block), (usually referring to bottom of web page or to last lines of HTML code), or and instead of . Some deprecated elements from
HTML 4.01 have been dropped, including purely presentational elements such as and , whose effects have long been superseded by the more capable
Cascading Style Sheets. There is also a renewed emphasis on the importance of client-side
JavaScript used to create
dynamic web pages. The HTML5 syntax is no longer based on
SGML despite the similarity of its markup. It has, however, been designed to be backward-compatible with common parsing of older versions of HTML. It comes with a new introductory line that looks like an SGML
document type declaration, <!DOCTYPE html>, which triggers the standards-compliant
rendering mode. Since 5 January 2009, HTML5 also includes
Web Forms 2.0, a previously separate
WHATWG specification.
New APIs In addition to specifying markup, HTML5 specifies scripting
application programming interfaces (APIs) that can be used with
JavaScript. • Timed Media Playback; • Offline; • Editable content; •
Drag and drop; • History; •
MIME type and protocol handler registration; •
Microdata; •
Web Messaging; •
Web Storage – a key-value pair storage framework that provides behavior similar to
cookies but with larger storage capacity and improved API. Not all of the above technologies are included in the W3C HTML5 specification, though they are in the WHATWG HTML specification. Some related technologies, which are not part of either the W3C HTML5 or the WHATWG HTML specification, are as follows. The W3C publishes specifications for these separately: •
Geolocation; •
IndexedDB – an indexed hierarchical key-value store (formerly WebSimpleDB); •
File – an API intended to handle file uploads and file manipulation; • Directories and System – an API intended to satisfy client-side-storage use cases not well served by databases; • File Writer – an API for writing to files from web applications; •
Web Audio – a high-level JavaScript API for processing and synthesizing audio in web applications; • ClassList. •
Web cryptography API •
WebRTC •
Web SQL Database – a local
SQL Database (no longer maintained); HTML5 cannot provide animation within web pages. Additional JavaScript or
CSS3 is necessary for animating HTML elements. Animation is also possible using JavaScript and HTML 4, and within SVG elements through
SMIL, although browser support of the latter remains uneven .
XHTML5 (XML-serialized HTML5) XML documents must be served with an XML
Internet media type (often called "
MIME type") such as application/xhtml+xml or application/xml, and must conform to strict, well-formed syntax of XML. XHTML5 is simply XML-serialized HTML5 data (that is, HTML5 constrained to XHTML's strict requirements, e.g., not having any unclosed tags), sent with one of XML media types. HTML that has been written to conform to both the HTML and XHTML specifications and therefore produces the same DOM tree whether parsed as HTML or XML is known as
polyglot markup. There is no DTD for XHTML5.
Error handling HTML5 is designed so that old browsers
can safely ignore new HTML5 constructs. Although HTML5 now defines a consistent behavior for "
tag soup" documents, those documents do not conform to the HTML5 standard. Another report released in August 2013 has shown that 153 of the
Fortune 500 U.S. companies implemented HTML5 on their corporate websites. Since 2014, HTML5 is at least partially supported by most popular layout engines.
Differences from HTML 4.01 and XHTML 1.x The following is a cursory list of differences and some specific examples. • New parsing rules: oriented towards flexible parsing and compatibility; not based on SGML • Ability to use inline SVG and MathML in text/html • New elements: article, aside, audio, bdi, canvas, command, data, datalist, details, embed, figcaption, figure, footer, header, keygen, mark, meter, nav, output, progress, rp, rt,
ruby, section, source, summary, time, track, video, wbr • New types of form controls: dates and times, email, url, search, number, range, tel, color • New attributes: charset (on meta), async (on script) • Global attributes (that can be applied for every element): id, tabindex, hidden, data-* (custom data attributes) • Deprecated elements will be dropped altogether: acronym, applet, basefont, big, center, dir, font, frame,
frameset, isindex, noframes, strike, tt W3C Working Group publishes "HTML5 differences from HTML 4",{{cite web ==Logo==