Thursday, November 13, 2008

Step HTML Part 1

Your first Web Page - An Introduction to HTML

Here you are going to familiarise yourselves with HTML and at the same time make a Web page. The tool we will use to make your first Web page is a simple text editor called Notepad which is available for free on all versions of windows. I recommend you follow these exercises on your own computer.

Exercise 1

1.Open Notepad and type the following:
Make Your own Web pages-for free

2. Save the file as my-first-web-page.txt in a directory on your computer (eg C:\webs\BYO directory).

3. Close Notepad and then open the File my-first-web-page.txt in notepad. Notepad should display my-first-web-page.txt as shown in Figure 1 below:


Figure 1. Text page displayed by notepad


Exercise 2


1. Now open the file my-first-web-page.txt in notepad and change it to the following:

< html >

Starting HTML- my first web page

< /HTML >

2. Then save the file as my-first-web-page.txt. Open the file again using notepad. Notepad should display my-first-web-page.txt as shown in Figure 2 below:


Figure 2. An HTML page as displayed by notepad

Notepad doesn’t know that is actually a formatting tag and not meant to be displayed, so it displays it as normal text.

Now save the file this time as my-first-web-page.htm and then open it again. This time it should open with Internet Explorer. Internet explorer should display my-first-web-page.htm as shown in Figure 3 below:



Figure


3. An HTML page as displayed by Internet Explorer

Notice that the <> tags are missing as the browser knows what to do with them and uses them to structure and format the text but doesn’t display them.



File Extensions .htm and .txt

The file extension .htm or .txt defines what application is used to open the file. Files ending with .txt files are opened by Notepad (or any other text editor) and .htm or .html extensions are opened by Internet Explorer.

Extensions .htm and .html

Web pages have the .htm or .html file extension e.g index.htm or index.html. Which one you use is up to you but if you start using .htm then stay consistent and save all you files as .htm files. All web pages on this server use the .htm extension and not .html.

Continue to next part2
.
.
.

No comments: