HTML Menu


Basic Tags in HTML


HTML provides following basic tags to work with hypertext documents.

  • <html> tag:

    This is the basic tag of HTML document. By using this tag the browser can identifies the weather it is html document or not.

    format :
    <html>
    ----
    ----
    </html>
    
  • <head> tag:

    It indicates the first part of HTML document, and it contains control information and title of document.

    format :
    <head>
    ----
    ----
    </head>
    
  • <title> tag:

    It is used to display title of document.

    format :
    <title>
    title of document
    </title>
    
  • <body> tag:

    It indicates the second part of HTML document, and it contains content that displayed on screen and tags which control how that content is formatted by browser.
    Body tag has different parameters which includes background,bgcolor...
    background: specifies an image as background for web page.
    bgcolor: specifies color as background for web page.

    format :
    <body bgcolor="#f5f5f5">
    content of body
    </body>
    
  • <br/> tag :

    It is used to break the current line (or) moves to next line.

    format :
    <br/> or <br>
    
  • <hr/> tag :

    It is used to insert horizontal rule or line.

    format :
    < hr [ width=n ] [ size=n ] [ align="left" | "center" | "right" ] />

Example 1: "welcome.html"
<html>
<head>
<title>Welcome</title>
</head>
<body>
<h1>Welcome to HTML</h1>
</body>
</html>

Output:
welcome

Blocks in HTML

  • <p> tag:

    It is used to display paragraph in HTML document. And it has common parameter i.e "align".

    format :
    <p [ align="left" | "center" | "right" ] >
    ------
    </p>
    
  • Heading tags :

    These are simple forms of text formatting that vary text sizes based on header level.
    Those are

    format :
    <h1> ----</h1>	Max size
    <h2>-----</h2>	|
    <h3>-----</h3>	|
    <h4>-----</h4>	|
    <h5>-----</h5>	v
    <h6>-----</h6>	Min size
    

Example 2: "blocks.html"
<html>
<head>
<title>Blocks Example</title>
</head>
<body bgcolor="#9ae5e5">
<h1 align="center">HTML</h1>
<hr/>
<p> HTML stands for Hyper Text Markup Language,It used to create static web pages.<br/>
HTML supports different types of tags those are html,head,title,h1,h2 and etc..</p>
Heading tags are <br/>
<h1>HTML</h1>
<h2>HTML</h2>
<h3>HTML</h3>
<h4>HTML</h4>
<h5>HTML</h5>
<h6>HTML</h6>
</body>
</html>

Output:
blocks

Next Topic :Text Formatting Tags in HTML