Understanding HTML

Once you create an HTML document it can be viewed in any browser.

Understanding HTML

Understanding HTML

In this unit we are going to learn some basic of hyper text markup language which is used to write HTML. Once you create an HTML document it can be viewed in any browser. After finishing this chapter , you will be able to write web documents. Once you create your web pages you upload these pages to your site using any FTP software. this unit discuss the basic tags required for creating the HTML document

HTML is basically a language for the web site creation (or publishing the content on web). HTML is very easy and anyone can learn it in no time. So get ready to learn very simple language the HTML.

What is HTML Document?
HTML stands for Hyper Text Markup Language, and it is the language for web. It describes the structure and presentations of a web document (web page). HTML documents are plain-text (also known as ASCII) files that can be created using any text editor (e.g., Emacs or vi on UNIX machines; SimpleText on a Macintosh; Notepad on a Windows machine).

Here are a few simple HTML tags. In HTML all tags are enclosed by < and > brackets.

 

Tag Description
<!--comment--> The Comment tag in HTML
<html> </html> Encloses the entire document
<head> </head> Encloses the head of the document
<meta> Provides information about the document
<title> </title> The title of the document
<body> </body> Encloses the body (text and tags) of the HTML document.

 

Writing First HTML

HTML document consists of HTML elements, which are defined using HTML tags.

  • HTML tags are used to mark-up HTML elements
  • All the HTML tags are surrounded by the two characters < and >. These surrounding characters are called angle barackets.
  • The HTML tags normally come in pairs like <b> and </b>
  • HTML tags are case insensitive <p> means the same as <P>

Hello World HTML

Here is the code of our first HTML document, which displays "Hello World" on the browser.

<html>
<head>
<title>Hello World</title>
</head>
<body>
<p>Hello World</p>
</body>
</html>

The HTML document stat with <html> tag and ends with </html> tag. Within this html other tags are defined to make the document. The title tag:

<title>Hello World</title>

displays the title "Hello Word" in the browsers title bar.

The <p>...</p> is an HTML element, which displays the paragraph on the browser:

<p>Hello World</p>

The HTML element starts with a start tag: <p> and ends with </p> end tag.

The purpose of the <body> tag is to define the HTML element that contains the body of the HTML document.

Testing HTML document

Copy the code:

<html>
<head>
<title>Hello World</title>
</head>
<body>
<p>Hello World</p>
</body>
</html>

and create "helloworld.htm" using any editor with the above content. Make sure that the extension of the file is ".htm". To test you html document, double click on it. This will open web browser and display your page.