• In order to create a page using HTML the Basic syntax to write HTML is:

They are : <html> , <head> , <body>
Out of these 3 tags, <html> tag is the outer most tag. The other two tags  can also be called as blocks.

  • Difference between <head> and <body> tag.
  • <head> tag is that tag in html which is loaded first. It is loaded even before <body> tag gets loaded. Whatever we want to display before creating the view, must be written in <head> tag.
  • <body> tag is the tag where we can write the actual content to generate the output to be displayed on the white area of your browser.

Now let us consider that you want to open a website say www.ankit.co
HTML Title
As we can see here, before the site gets loaded we can see some text like “Ankit Virparia – A Programmer” being displayed on the title bar. This can be done by writing the title in the <head> section.

Simple program to display a title of web page:
<head>
<head>
<title> Welcome to the world of HTML</title>
</head>
</html>

Output:
Title Example


In the above code we have <title> tag inside the <head> section. There are some other things also which can be included in <head> section such as scripts, CSS and linking of other files.
Example program :
<head>
<head>
<title> Welcome to the world of HTML</title>
</head>
<body>
Welcome to my website.
</body>
</html>

Output:

1st html page