HTML and CSS Reference
In-Depth Information
HTML5 may include XML-style syntax, both of these languages can be embedded with-
in a regular HTML page. These will be touched on further in Appendix A.
APIs
In the spirit of creating a platform for web application development, HTML5 introduces
a number of scripting application programming interfaces (APIs). These include addi-
tions to the JavaScript API that allow elements to be selected via their classes. For ex-
ample, using array syntax, the first element on a page with the class attribute set to
aClass could be retrieved via JavaScript with the following:
document.getElementsByClassName("aClass")[0]
Also added are APIs associated with the new elements, such as a means to control
video and audio playing within the new video and audio elements. Additional func-
tionality added includes handling drag-and-drop user interaction, getting access to the
web browser history state, and storing web page data in a cache for later retrieval in an
offline state. There are also a number of related APIs that work with HTML5 but ac-
tually fall under separate specifications. A notable one in this category is the Geoloca-
tion API, which provides a means to handle location data within a web context. Later
chapters will explore these APIs in greater detail.
No longer SGML conforming (again!)
Well, frankly you are unlikely to notice this change at all. HTML in its purest form
originally developed from Standard Generalized Markup Language (SGML), a much
older markup language. However, the HTML implemented by web browsers did not
fully comply with the SGML specification, and HTML5 has simply codified that fact.
HTML5 has syntactic elements borrowed from SGML, HTML, and XHTML1. x , mak-
ing it an amalgamated language distinct in its own right.
Obsolete features
There is a bit of a catch-22 in HTML5, in that it must remain compatible with old fea-
tures of HTML, while discouraging the use of certain elements that are no longer con-
sidered acceptable to use. For instance, HTML contains certain markup that is present-
ational in nature, meaning the effect it has on its content is to stylize its appearance in
some way (the font element, for example). Presentational markup has long since been
usurped by Cascading Style Sheets (CSS), so the majority of these features have been
deprecated. Authors should not use these elements any longer, even though they still ap-
pear in the HTML specification. These elements are not simply removed from the spe-
Search WWH ::




Custom Search