What is HTML5?
What we understand today as HTML5 has had a relatively turbulent history. You
probably already know that HTML is the predominant markup language used to
describe content, or data, on the World Wide Web. HTML5 is the latest iteration of
that markup language, and includes new features, improvements to existing features,
and scripting-based APIs.
That said, HTML5 is not a reformulation of previous versions of the language—it
includes all valid elements from both HTML4 and XHTML 1.0. Furthermore, it’s
been designed with some primary principles in mind to ensure it works on just about every platform, is compatible with older browsers, and handles errors gracefully.
A summary of the design principles that guided the creation of HTML5 can
be found on the W3C’s HTML Design Principles page1.
First and foremost, HTML5 includes redefinitions of existing markup elements, and
new elements that allow web designers to be more expressive in the semantics of
their markup. Why litter your page with divs when you can have articles, sections,
headers, footers, and more?
The term “HTML5” has additionally been used to refer to a number of other new
technologies and APIs. Some of these include drawing with the <canvas> element,
offline storage, the new <video> and <audio> elements, drag-and-drop functionality,
Microdata, embedded fonts, and others. In this book, we’ll be covering a number
of those technologies, and more.
It should also be noted that some of the technologies that were once part of HTML5
have been separated from the specification, so technically, they no longer fall under
the “HTML5” umbrella. Certain other technologies were never part of HTML5, yet
have at times been lumped in under the same label. This has instigated the use ofbroad, all-encompassing expressions such as “HTML5 and related technologies.”
Bruce Lawson even half-jokingly proposed the term “NEWT” (New Exciting Web
Technologies)2 as an alternative.
However, in the interest of brevity—and also at the risk of inciting heated arguments—
we’ll generally refer to these technologies collectively as “HTML5.”
How did we get here?
The web design industry has evolved in a relatively short time period. Twelve years
ago, a website that included images and an eye-catching design was considered
“top of the line” in terms of web content.
Now, the landscape is quite different. Simple, performance-driven, Ajax-based web
apps that rely on client-side scripting for critical functionality are becoming more
and more common.Websites today often resemble standalone software applications,
and an increasing number of developers are viewing them as such.
Along the way, web markup evolved. HTML4 eventually gave way to XHTML,
which is really just HTML 4 with strict XML-style syntax. Currently, both HTML 4
and XHTML are in general use, but HTML5 is gaining headway.
HTML5 originally began as two different specifications: Web Forms 2.0 and Web
Apps 1.0. Both were a result of the changed web landscape, and the need for faster,
more efficient, maintainable web applications. Forms and app-like functionality
are at the heart of web apps, so this was the natural direction for the HTML5 spec
to take. Eventually, the two specs were merged to form what we now call HTML5.
During the time that HTML5 was in development, so was XHTML 2.0. That project
has since been abandoned to allow focus on HTML5.
Would the real HTML5 spec please stand up?
Because the HTML5 specification is being developed by two different bodies (the
WHATWG and the W3C), there are two different versions of the spec. The W3C (or
World Wide Web Consortium) you’re probably familiar with: it’s the organization
that maintains the original HTML and CSS specifications, as well as a host of otherweb-related standards, such as SVG (scalable vector graphics) and WCAG (web
content accessibility guidelines.)
The WHATWG (aka the Web Hypertext Application Technology Working Group),
on the other hand, might be new to you. It was formed by a group of people from
Apple, Mozilla, and Opera after a 2004 W3C meeting left them disheartened. They
felt that the W3C was ignoring the needs of browser makers and users by focusing
on XHTML 2.0, instead of working on a backwards-compatible HTML standard. So
they went off on their own and developed theWeb Apps andWeb Forms specifications
discussed above, which were then merged into a spec they called HTML5. On
seeing this, the W3C eventually gave in and created its own HTML5 specification
based on the WHATWG’s spec.
This can seem a little confusing. Yes, there are some politics behind the scenes that
we, as designers and developers, have no control over. But should it worry us that
there are two versions of the spec? In short, no.
The WHATWG’s version of the specification can be found at
http://www.whatwg.org/html/, and has recently been renamed “HTML” (dropping
the “5”). It’s now called a “living standard,” meaning that it will be in constant development
and will no longer be referred to using incrementing version numbers.3
TheWHATWGversion contains information covering HTML-only features, including
what’s new in HTML5. Additionally, there are separate specifications being developed
by the WHATWG that cover the related technologies. These specifications
include Microdata, Canvas 2D Context, Web Workers, Web Storage, and others.4
The W3C’s version of the spec can be found at http://dev.w3.org/html5/spec/, and
the separate specifications for the other technologies can be accessed through
http://dev.w3.org/html5/.
So what’s the difference between the W3C spec and that of WHATWG? Briefly, the
WHATWG version is a little more informal and experimental (and, some might argue,
more forward-thinking). But overall, they’re very similar, so either one can be used
as a basis for studying new HTML5 elements and related technologies.