All html documents must have a certain format and a few tags in them. Here is the syntax:
<html>
<head>
<title></title>
</head>
<body>
</body>
</html>
Each html document starts with the <html> tag and ends with the </html> tag. Inside the <html> tag, there should be two sets of tags. One set is the <head> tag and another is the <body> tag. Each set serves a different function. The <title> tag set goes inside the <head> tag set. Whatever you type inside the <title> tag would be displayed on the top portion of the frame of the window of your browser. The <meta> tag also goes inside the <head> tag. We discuss the <meta> tag in detail in a later lesson. I mentioned this now so that you don't feel that you are missing out on something when you see this tag on someone else's page. But how do you see the html code of someone else's page? You will know how to do this by the time you get to the end of this page. The <body> tag controls everything that you see inside the window. There are only two sets of tags which can go inside a <head> tag, but there is a large variety of tags which go inside a <body> tag. You will find out what these tags are and learn how to use them in detail in the lessons.
It is now time to write your first program. If you are on a PC which has either windows 95/98/NT/2000/XP, click on start--programs--accessories--notepad. If you have windows 3.1, double-click on notepad in the program menu. From here onwards, instructions are the same for windows 3.1/95/98/NT/2000/XP. Click on file--new. Type the following exactly the way it is typed below.
<html>
<head>
<title> This will show on the upper portion of the frame of the window </title>
</head>
<body> anything I type here will be displayed inside the window. </body>
</html>
Now click on file--save as. This will open the save as window. You will see 4 fields (places where you can type something). In the topmost field you can choose where you want to save the file by clicking on the arrow which is pointing downwards and choosing the place. I always save my files on the desktop while I am developing the page. It makes it easy to locate and open. Leave the big field which is right below it, alone. Now move to the field below it. It should have something like untitled.txt in it. If it doesn't, do not worry. Just type mypage.html in it whether you see untitled.txt or not. In the field below choose all files. Then click on save.
Tip: Did you know that you can move from between fields by hitting tab. Sorry, I was just trying to act like microsoft, but what I said is true.
You should now have a file by the name of mypage.html wherever you saved it. Go to it and doubleclick on it. If you have a browser, it should open this page in the browser. I think it is safe to assume that you have a browser, because if you didn't, you wouldn't be viewing my page. Try typing different things between the tags and see what happens.
Before moving on to the next page, I would like to show you how to view someone else's HTML code, as promised. On this window click on view and then choose page source. Voila, you have the code.