3.4 HTML Documents

Every HTML document begins with the <HTML> tag and ends with the corresponding end tag </HTML>.  A document has the following two sections.

1. Head

2. Body

How to start and finish an HTML document?

1. Type <HTML>

2. Create your HTML document.

3. Type </HTML>

The head section

The head section begins with the <HEAD> tag and ends with </HEAD> tag.  In the head section title is the most important item.  The title begins with <TITLE> and ends with </TITLE>

How to create a head section?

  1. After the initial <HTML> tag type <HEAD>
  2. Type <TITLE> Your title goes here
  3. Type </TITLE>
  4. Type </HEAD>

Sample code for creating the head section

<HTML>

<HEAD>

<TITLE> Travel Guide to Europe </title>

</HEAD>

The body section

The body section of your HTML document contains the bulk of your web page contents, including all the text, graphics and formatting.

How to create the body section?

  1. After the </Head> tag and before anything else type<BODY>
  2. Create content using other tags.
  3. Type </BODY> before the final </HTML> tag.

A typical body section template looks like the following:

<HTML>

<HEAD>

<TITLE> Travel Guide to Europe </title>

</HEAD>

</HTML>

————————————————–

————————————————–

</BODY>

</HTML>

The Properties of attributes of a <BODY> tag

The <BODY> tag has several attributes.  The following is a partial list.

  • Background design (background, can be an image)
  • Background color (bg color)
  • Text color (text)
  • Hyper Link color (link)
  • Active link color (alink)
  • Visited link color (vlink)

Example – 3.1 Your First HTML document.

Type the following in a notepad or word pad and save it as “example1.html”.  Open an Internet Browser like Internet Explorer or Netscape Navigator and type path/example1.html and press the enter key.

<HTML>

<HEAD> <TITLE> My First Web Page </TITLE> </HEAD>

<BODY>

<P>

<FONT SIZE=”20 pt “ COLOR =NAVY>

<B> BHARATHIDASAN UNIVERSITY </B>

</FONT>

<BR>

<FONT SIZE = “10pt”>

Trichy, India.

</FONT>

</P>

</BODY>

</HTML>

 

  • Note: HTML tags can be typed using lower case letters.  Eg. <html>

 

 

Sign-up for our email newsletter and get free job alerts, current affairs and GK updates regularly.
Subscribe Here (or)

One Response to “3.4 HTML Documents”

  1. Deepa Lakshmi says:

    Simple and crystal clear.

Leave a Reply

Your email address will not be published. Required fields are marked *


− 9 = zero

Popup Dialog Box Powered By : XYZScripts.com
  • RSS
  • Facebook
  • Google+
  • Twitter