Wednesday, June 10, 2009

Getting Started with HTML

HTML as we have already seen is defined as HyperText Markup Language, consists of many tags or elements that define the property of the text or image or any other stuff you add within it.

HTML tags, nearly all of them, come in pairs, for example, to indicate a paragraph we use the 'p' tag i.e < p > and < /p >. Any text within < p > and < /p > is defined as a paragraph. Here < p > is the start tag and < /p > is the end tag.

Every HTML document starts with the 'html' start tag < html > and end with the html end tag < /html >. A html document consists of 2 main divisions, the head denoted by the head tag(< head > and < /head >) and body denoted by the body tag (< body > and < /body >).

The head tag contains all the information like the styles used, description for the web page, links to any external style sheet or scripts(internal and external) which we will come to later in the series.

The body tag is where all the "visible" data goes. If anything is to be displayed on the web page it MUST be written within the body tag i.e < body > and < /body >.

A basic example of a HTML document is given below:

< html >
< head >
< /head >
< body >
< h1 > this is my first heading < /h1 >
< p > this is my first paragraph. You can create any number of headings and paragraphs as you want.. < /p >
< /body >
< /html >


You can see the browser output of this code in the image below. Click on it to see it in full size.

Now that we have seen and understood the basics of writing HTML document, let us see how to write it. For creating a HTML document like the one above, you can use any simple text-editor like Notepad for Windows and save the output as .html . Or you can choose HTML editors like Textpad or Notepad++ or some high level editors like Adobe Dreamweaver. I suggest you use Notepad++, a free ware, which is light on the system and is simple to install and use. Textpad is not a freeware and can be equally good. So any of these two would be perfect to start with. Just save the file as *****.html and view it any browser you want and you can see the result there.

Next i will be talking about HTML elements. So till then, See ya.

No comments:

Post a Comment