Tuesday, October 19, 2010

The Prelimary HTML Tags

Tags are instructions or control codes to an Internet browser that formats texts displayed in a website. In other words, it tells the Internet browser (Internet Explorer, Mozilla Firefox, NetScape, etc) how to present texts, graphics, and links to the Internet users. Some tags are simple while some are complex, as we will see very soon. Tags are not case sensitive. Thus, as an example, <title>, <Title>, <TITLE> are the same. However, uppercase (capital letter) makes the tags to stand out better from their surrounding texts. This is useful, especially when checking through a HTML document to find out why the formatting did not work properly.

All tags are enclosed in angular brackets <>. Most tags come in pairs; one to mark the start of the formatting style, and the other to mark the end. The tags in each pair are identical, except that the closing tag starts with a forward slash (/). For example, we can write:

<H1> This is an Internet text book. </H1>

or for easier reading, we may put the tags on separate lines, thus:

<H1>
This is an Internet text book.
</H1>

Every HTML document (i.e. website document), as a tradition, starts with the tag <HTML> and ends with the corresponding tag </HTML>. So, in its simplest form, a HTML document might appear thus:

<HTML>
body of the document or website
</HTML>

This means that all other tags that will be included in the body of the document must appear between <HTML> and </HTML>.

In general, a HTML document can be divided into two parts, namely: the head part and the body part. The head part is enclosed by <HEAD> and </HEAD> and it contains the title and any other annotations. The head part is not displayed, except the title which appears on the title bar (the top of the Internet browser where the website name suppose to appear if there is no title). The body part is enclosed by <BODY> and </BODY> and it contains the texts that will appear on the website pages. The body part contains other tags for formatting texts in the website pages. Consider the following HTML document:

<HTML>
<HEAD>
<TITLE> Internet Lecture Conference. </TITLE>
</HEAD>
<BODY>
<P>
All students are welcome to this maiden Internet Lecture.
</P>
</BODY>
</HTML>

In the above HTML document, “Internet Lecture Conference” is the title and it constitutes the head part; “All students are welcome to this maiden Internet Lecture.” is the website page text and it constitutes the body part. The tag <P> is used to start a paragraph and </P> terminates the paragraph.

Note: The tags <HTML>, <HEAD>, and <BODY> with their corresponding closing tags </HTML>, </HEAD>, and </BODY> can be omitted. They are normally included just as a tradition or convention, or just to complete a given standard.

The main text-formatting tags will be treated in our subsequent topics. Keep checking for updates in this site.