Your Digital Companion

Friday, June 24

All U Need To Know : HTML 5

 

HTML 5HTML5 is a language for structuring and presenting content for the World Wide Web, a core technology of the Internet. It is the fifth revision of the HTMLstandard (originally created in 1990 and most recently standardized as HTML4 in 1997) and as of June 2011 was still under development. Its core aims have been to improve the language with support for the latest multimedia while keeping it easily readable by humans and consistently understood by computers and devices (web browsersparsers etc.). HTML5 is intended to subsume not only HTML4, but XHTML1 and DOM2HTML (particularlyJavaScript) as well.

Following its immediate predecessors HTML 4.01 and XHTML 1.1, HTML5 is a response to the observation that the HTML and XHTML in common use on the World Wide Web is a mixture of features introduced by various specifications, along with those introduced by software products such as web browsers, those established by common practice, and the many syntax errors in existing web documents. It is also an attempt to define a single markup languagethat can be written in either HTML or XHTML syntax. It includes detailed processing models to encourage more interoperable implementations; it extends, improves and rationalises the markup available for documents, and introduces markup and APIs for complex web applications.

In particular, HTML5 adds many new syntactical features. These include the <video><audio>, and <canvas> elements, as well as the integration ofSVG content. These features are designed to make it easy to include and handle multimedia and graphical content on the web without having to resort to proprietary plugins and APIs. Other new elements, such as <section><article><header>, and <nav>, are designed to enrich the semanticcontent of documents. New attributes have been introduced for the same purpose, while some elements and attributes have been removed. Some elements, such as <a><cite> and <menu> have been changed, redefined or standardised. The APIs and DOM are no longer afterthoughts, but are fundamental parts of the HTML5 specification. HTML5 also defines in some detail the required processing for invalid documents, so that syntax errors will be treated uniformly by all conforming browsers and other user agents.

 

History

The Web Hypertext Application Technology Working Group (WHATWG) began work on the new standard in 2004, when the World Wide Web Consortium(W3C) was focusing future developments on XHTML 2.0, and HTML 4.01 had not been updated since 2000. In 2009, the W3C allowed the XHTML 2.0 Working Group's charter to expire, and decided not to renew it. W3C and WHATWG are currently working together on the development of HTML5.

Even though HTML5 has been well-known among web developers for years, it became the topic of mainstream media in April 2010 after Apple Inc's CEO Steve Jobs issued a public letter titled "Thoughts on Flash" where he concludes that with the development of HTML5, Adobe Flash is no longer necessary to watch video or consume any kind of web content. This sparked a debate in web development circles where some suggested that while HTML5 provides enhanced functionality developers must consider the varying browser support of the different parts of the standard as well as otherfunctionality differences between HTML5 and Flash.

:: New Features ::

Markup

HTML5 introduces a number of new elements and attributes that reflect typical usage on modern websites. Some of them are semantic replacements for common uses of generic block (<div>) and inline (<span>) elements, for example <nav> (website navigation block), <footer> (usually referring to bottom of web page or to last lines of HTML code), or <audio> and <video> instead of<object>. Some deprecated elements from HTML 4.01 have been dropped, including purely presentational elements such as <font> and <center>, whose effects are achieved usingCascading Style Sheets. There is also a renewed emphasis on the importance of DOM scripting (e.g., JavaScript) in Web behavior.

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. As of 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). Existing document object model (DOM) interfaces are extended and de facto features documented. There are also new APIs, such as:

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.

A common misconception is that HTML5 can provide animation within web pages, which is untrue. Either JavaScript or CSS3 is necessary for animating HTML elements. Animation is also possible using JavaScript and HTML 4.


XHTML5

XHTML5 is the XML serialization of HTML5. XML documents must be served with an XML Internet media type such as application/xhtml+xml or application/xml. XHTML5 requires XML’s strict, well-formed syntax. The choice between HTML5 and XHTML5 boils down to the choice of a MIME/content type: the media type you choose determines what type of document should be used.[41] In XHTML5 the HTML5 doctype html is optional and may simply be omitted. HTML that has been written to conform to both the HTML and XHTML specifications — and which will therefore produce the same DOM tree whether parsed as HTML or XML — is termed "polyglot markup".


Error handling

An HTML5 (text/html) browser will be flexible in handling incorrect syntax. HTML5 is designed so that old browsers can safely ignore new HTML5 constructs. In contrast to HTML 4.01, the HTML5 specification gives detailed rules for lexing and parsing, with the intent that different compliant browsers will produce the same result in the case of incorrect syntax. Although HTML5 now defines a consistent behavior for "tag soup" documents, those documents are not regarded as conforming to the HTML5 standard.

Differences with 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 elementsarticleasideaudiobdocanvascommanddatalistdetailsembedfigcaptionfigurefooterheaderhgroupkeygenmarkmeternavoutput,progressrprtrubysectionsourcesummarytimevideowbr
  • New types of form controls: dates and timesemailurlsearchnumberrangetelcolor
  • New attributescharset (on meta), async (on script)
  • Global attributes (that can be applied for every element): idtabindexhiddendata-* (custom data attributes)
  • Deprecated elements will be dropped altogether: acronymappletbasefontbigcenterdirfontframeframesetisindexnoframesstrikett

dev.w3.org provides the latest Editors Draft (last dated 10 May 2011) of HTML5 differences from HTML4, which provides a complete outline of additions, removals and changes between HTML5.

The W3C HTML5 logo

On January 18, 2011, the W3C introduced a logo to represent the use of or interest in HTML5. Unlike other badges previously issued by the W3C, it does not imply validity or conformance to a certain standard. As of April 1, 2011, this logo is official.

When initially presenting it to the public, the W3C announced the HTML5 logo as a "general-purpose visual identity for a broad set of open web technologies, including HTML5, CSSSVGWOFF, and others". Some web standard advocates, including The Web Standards Project, criticised that definition of "HTML5" as an umbrella term, pointing out the blurring of terminology and the potential for miscommunication.Three days later, the W3C responded to community feedback and changed the logo's definition, dropping the enumeration of related technologies. The W3C then said the logo "represents HTML5, the cornerstone for modern Web applications".