Simple HTML Page

Let's understand HTML Page structure with an example. So, here we create a file index.html

index.html

<!DOCTYPE html>
<html>
<head>
 <title>This is Title</title>
</head>
<body>
 This is Heading 1
  This is paragraph 
</body>
</html>

Let's go through each part one by one.

1) <!DOCTYPE html> :- This is used to define the version of HTML we want to use in our page. Latest is HTML5 and  is now used commonly everywhere. So, when we want to use version 4 of HTML( which we will of-course not use anywhere) we will write something like :-  

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">.

So, the above index.html will look like:- 

index_html4.html

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
 <title>This is Title</title>
</head>
<body>
 This is Heading 1
  This is paragraph 
</body>
</html>

But from HTML5 we just write <!DOCTYPE html> that's all and every browser will understand that we are using HTML5.

2) <html></html> :-  This contains all the content of any web page. So, whatever we write will remain in this tag.