HTML 5 vs. Older HTML Versions: New Doctype, Charset and Page Structure
HTML 5 vs. Older HTML Versions: New Doctype, Charset and Page Structure
The promise is that HTML 5 will redefine the web, most likely removing the likes of Adobe
Flash, MS Silverlight and Java FX.
This article will look into the new feature, and what’s been removed.
As HTML no longer uses SGML to define its Doctype, the doctype line in HTML can be made
much simpler.
<!doctype html>
Page Structure
HTML 3 – Remember using tables to specify the structure of the page? May be you still use
them?
HTML 5 – introduces a completely new set of elements to define the page structure.
Following examples show the differences between the HTML versions based on the page
structure below:
<canvas>
gives you a drawing canvas in JavaScript. The user can draw on the canvas and using
Javascript, you can track the drawing.
<video>
add video to your Web pages with this simple element.
<audio>
add an audio clip to your Web pages with this simple element.
<progress>
adds a progress bar on the page. You can use it while uploading or downloading something
from your site.
<meter>
represents a measurement such as disk usage.
The <input> element already exists, but new types have been introduced:
tel, search, url, email, datetime, date, month, week, time, datetime-local, number, range,
color
acronym , applet, basefont, big, center, dir, font, frame, frameset, isindex, noframes,
noscript, s, strike, tt, u
There are many additional elements that are available in HTML 5, some of these have been
summarized below:
Offline Mode
Due to technologies like AJAX came into existence, and the ability of making multiple
requests to the server, thus allowing pages to seem to load more efficiently as additional
resources are fetched asynchronously.
With HTML 5, you can specify what resources your page will require and the browser will
cache them so that the user can continue to use the page even if he/she gets disconnected
from the internet.
Local Database
HTML 5 has included a local database that will be persistent through your session. The
advantage of this is that you can fetch the required data and dump it into the local
database, thus reducing the burden of fetching duplicate data from the server. As you can
imagine, this will no doubt reduce the load on the server, as well as speed up
responsiveness of the website application.
Native JSON
JSON, or JavaScript Simple Object Notation is a popular alternative to XML, which was
almost the de-facto standard before the existence of JSON. Until HTML 5, you needed to
include libraries to encode and decode JSON objects. Now, the JavaScript engine that ships
with HTML 5 has built-in support for encoding/decoding JSON objects.
Multi-threaded JavaScript
JavaScript is the only language that allows you to perform client side scripting, and a large
proportion of websites use this website technology. The only setback of including
JavaScript on web pages is the time it takes to process the code, the more lines of JavaScript
you add to your web page; the longer it will take to process them. A solution to this is to
tell the browser that the script is only needed after the page has loaded, thus the JavaScript
is fetched asynchronously even after the page has loaded.
Below is a complete list of HTML tags, and which version supports it:
Tag Description 4 5
<comment> Defines a comment 4 5
<DOCTYPE> Defines the document type 4 5
<a> Defines a hyperlink 4 5
<abbr> Defines an abbreviation 4 5
<acronym> Not supported. Defines an acronym 4
<address> Defines an address element 4 5
<applet> Not supported. Defines an applet 4
<area> Defines an area inside an image map 4 5
<article> Defines an article 5
<aside> Defines content aside from the page content 5
<audio> Defines sound content 5
<b> Defines bold text 45
<base> Defines a base URL for all the links in a page 45
<basefont> Not supported. Use CSS instead 4
<bdo> Defines the direction of text display 45
<big> Not supported. Defines big text 4
<blockquote> Defines a long quotation 45
<body> Defines the body element 45
<br> Inserts a single line break 45
<button> Defines a push button 45
<canvas> Defines graphics 5
<caption> Defines a table caption 45
<center> Not supported. Defines centered text 4
<cite> Defines a citation 45
<code> Defines computer code text 45
<col> Defines attributes for table columns 45
<colgroup> Defines groups of table columns 45
<command> Defines a command button 5
<datagrid> Defines data in a tree-list 5
<datalist> Defines a dropdown list 5
<datatemplate> Defines a data template 5
<dd> Defines a definition description 45
<del> Defines deleted text 45
<details> Defines details of an element 5
<dialog> Defines a dialog (conversation) 5
<dir> Not supported. Defines a directory list 4
<div> Defines a section in a document 45
<dfn> Defines a definition term 45
<dl> Defines a definition list 45
Other Web Development and Search Engine Optimization articles are available on the
visualwebz.com website, under Web Design 101