Web developer

HTML 5 – As I Learn

Series – 2


My first look at HTML 5, the basic elements or tags – HTML, HEAD and BODY

<!DOCTYPE html>



<meta charset="utf-8">







Looks rather slim and trim. So lets compare the same for the previous version –

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"


<html xmlns="http://www.w3.org/1999/xhtml">


<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>HTML 4</title>






Wow! That means lot less to write. The declaration in the DOCTYPE tag are gone, only have to mention the type of document, which is html.

In the HTML tag no need to mention the xmlns attribute (namespace).

The META tag under HEAD tag also requires less – just the charset attribute for character set declaration. No need to mention the content is of type text/html – it is already mentioned in the DOCTYPE.

Now I questioned myself – what about language? Previously the language was mentioned in the DOCTYPEEN”. What happens in HTML 5?

A little search resulted in –

<!DOCTYPE html>

<html lang="en">

So in HTML5 we have to mention the language as an attribute (lang) to the HTML tag. The two letter language code is written in small.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: