Previous Next

HTML Introduction 

  • HTML stands for Hypertext Markup Language, and is used for creating web pages.
  • HTML is the standard markup language for web pages.
  • Hypertext is the text which contains links to other texts, web pages, graphics, video and sound.

  • HTML describes the structure of web pages using Markup.

  • HTML contains tags like "header", "body", "footer" to build a web page.

  • HTML tag describes to browser how to render the web page content.
  • Browsers do not display the HTML tags.

 

HTML Document Example

This is the very basic HTML document example

<!DOCTYPE html>
<html>
   <head>
      <title>HTML Tutorials</title>
   </head>
   <body>
      <h1>My First HTML Heading</h1>
      <p>My First HTML paragraph.</p>
   </body>
</html>

 

Purpose of Web Browser

The web browser reads a HTML document and displays them.

Web browser does not display the HTML tags, but uses them to display the HTML document.

 

HTML Document in Web Browser

HTML Hello World

HTML Tags in HTML Document

A typical HTML tag contains following structure:

<tagname>content goes here...</tagname>
  • HTML tags are element wrapped in angular brackets.
  • Normally they are declared in pair like <h1></h1>
  • First tag in pair is start tag and second pair is end tag.
  • End tag contains extra forward slash (/) before the tag name.

 

HTML Tags Explained

Above example of HTML document uses following tags:

Tag Description
<!DOCTYPE> This tag defines document type, for above example it is HTML.
<html> This element is the root element of HTML document.
<head> This element contains meta information about the HTML document.
<title> This element contains title of the HTML document.
<body> This element contains all the visible content of HTML document.
<h1> This element define a large heading for the HTML document.
<p> This element represents a paragraph for the HTML document.

 

HTML Document Structure

A HTML document contains following structure:

Document type declaration

<html>
<head> <title>Document title </title> </head>
<body> <h1>This is a heading</h1>
<p>This is a paragaph</p> </body>
</html>

 

The <!DOCTYPE> Declaration

The <!DOCTYPE> declaration defines the document type.

It must appear at the top of the document.

The <!DOCTYPE> declaration is not case sensitive.

The <!DOCTYPE> declaration for HTML is:

<!DOCTYPE html>

 


Previous Next