HTML Introduction

HTML Tutorial

HTML (Hyper Text Markup Language) contains tags, which is a command to tell the web browser how to display content on a web page.

HTML usually has an opening tag and a corresponding closing tag. The syntax for HTML tag is <tag-name>, for example :

<h1> opening tag (where h1 is the tag name)
</h1> closing tag ( “/” is placed before the tag name for closing tag)

All HTML tags are enclosed in the open angular bracket (<) and close angular bracket (>).

The HTML document or web page starts with <html> tag and closes with </html> tag. The <html> tag is the container for the entire data or content to be displayed on the web browser.

The HTML document is divided into head and body part or section. The head section is within <head> and </head> tags, whereas the body section is described within <body> and </body> tags.

Structure of HTML Document
Structure of HTML Document

The head section (<head> …  </head>) is used for identification information for the page and may also contain meta data. The body section (<body> …. </body>) contains the content of the page to be displayed in the browser.

The HTML code can be written in any text editor such a notepad in windows or vi editor in Linux systems. The HTML code can then be executed or the output of the HTML code can be displayed in any Web Browser such as Internet Explorer, Microsoft Edge, Mozilla Firefox or Google Chrome.

Let us see an example of an HTML code:

The above HTML code is written in the text editor where the title of the webpage is “First Program” which is inside <title> tag and output of the above code when executed in a web browser is displayed below:

The web browser understands the HTML tags and displays the content “This is the sample program” in the display area and the title is displayed in the title bar of the web browser.

The older versions of HTML were case insensitive, therefore <html> , <HTML> and <Html> were all means the same. But HTML4 / XHTML is case sensitive and requires all tags to be in lowercase. The HTML5 is again case insensitive but it is recommended to use all tags in lowercase.