Lab 4.1: Structure of HTML documents
Every web page that can be displayed through your browser is written on HTML language. Most browsers allow you to see the HTML "source code" of the displaying page. To do so in Internet Explorer, follow the View -> Source menu. Regardless of how complicated is a webpage, its basic structure is quite standard. In this set of exercises, you'll learn this structure by examine the source codes of some webpages. Refer to the short description for more information.
-
Use your browser to look over the HTML code for
- This page
- The webpage for Homework 3
- Any webpage of your interest
-
For each source identify and mark its following parts:
- The head and the body
- Opening tags and their closing tags (if any; for example <li> tag has no closing one)
-
Open Notepad and type in the following:
<html> <head> <title>My Homepage</title> </head> <body> Here goes the HTML body </body> </html>
-
Save this document as a text file under the name first.htm
. For this in the saving Notepad window choose the option "All files"
and type in the filename (first.htm). The .htm suffix tells the browser that
this file contains HTML code. If you do not provide this suffix, your HTML page
might not be displayed properly.
-
Open your browser and make it display the file first.htm For this in Netscape
click File -> Open Page and find the file first.htm in your system
by browsing the directories on your hard disk. When done click OK button.
Now your file should be displayed in the browser window.
- Repeat steps (4) and (5), changing your HTML code each time by inserting some of the HTML instructions you found in the sample pages you reviewed earlier. Try, for example, to set the background to some color, change the font and so on. Then, experiment with different text colors for displaying the text.