Structure of HTML & Basic Tags l

 Structure of HTML & Basic Tags 









-    HTML as a markup language used to design static web pages or web documents.

-   For this the instructions or statements of HTML are called as Tags which must be used in < & > (angular brackets) like <FONT>, <Head> ,etc.

-   These tags can be either paired/container tag or empty or unpaired tag.

-  To use this, the standard structure used is:

<html>

<head>

        <title> Any meaningful title </title>

</head>

<body> 

     ---contents of web page-----

</body>

</html>

-  As per the above structure, HTML supports basic tags like:

i)   <HTML> - it is one type of paired tag, which shows start and end part of any web page. Between this other supporting tags to be enclosed.

-   By this, browser understands what is the format of web page or contents.

      Syntax :

       <HTML>

         ----

       </HTML>

it is one type of paired tag, which is used for:

n  Assigning proper title to web page.

n  Include script code using <Script> tag 

as:

<script language=”JavaScript”>

---

</script>

 

Syntax :

<HEAD>

----

</HEAD>

iii)      <Title>

it is one type of paired tag, which is used to assign a valid and easy to understand title to page. It must be enclosed in <Head> tag.

Syntax :    <Head>

                  <Title> any Title </Title>

 

                 </Head>


iv)  <Body> - it is one type of paired tag, which is used to enclose the contents of web page to be displayed in browser.

-  Browser ignores the tag and shows the rest of the contents in browser.

-   <Body> - it is one paired tag, it is used to create body of web page. It is used to show different contents like Tables, images, hyperlinks, audio, video, etc.

-    With <body> tag, following attributes can be used :


i)   bgcolor- using this property, background color to web page can be applied. Color can be applied in following ways:


a)  color name – any color name can be used as:

 

<body bgcolor=”red”>

 

b)   using RGB code- by combining color codes of Red, Green & Blue color, new color can be applied. For this it must start with “#” as:

<body bgcolor=#786523>

 

i)     background – by this any graphical image can be set in web page background. That image can be from current location or any other location as:

<body background=”sun.jpg”> 

Or

<body background=”D:\images\sun.jpg”>

 <Body> tag can also enclose <script> code.

Tags of HTML are generally classified as:

 i)Empty Tag Tag without content called as Empty tag. Such tag don’t uses any closing tag.

- Element without closing tag is called empty tag.

e.g. <br>


 ii)Container / Paired Tag – Element which is having corresponding closing tag is called Container / Paired Tag.

e.g. <BODY> --------</BODY>

        <FONT>--------</FONT>

Comments