IS221 Lab3 PDF
IS221 Lab3 PDF
Note:
It is recommended that students go over this lab handout and come prepared before attending the
lab class.
This will help students complete the lab activities within the allocated time, and without much
difficulty. Complete any Pre-lab activities before starting with this lab activity.
Please also carry a USB Flash disk with you to the lab class. It is recommended that you save off
all your work onto your flash disk.
In this lab
This lab activity will focus on the XHTML elements that affect the web page layout. The exercise for
this week will require you to create a web page for a document that exists in a different format.
Lab 3 1/8
Creating web page layout using <table>s and <div>s
Displaying data in tabular form in XHTML
Using tables for web page layout
Creating a simple navigation menu
Background
The following links contain useful information that will help student’s with this week's lab activities:
w3schools.com (http://www.w3schools.com/)
XHTML 1.0 Tag Reference (http://www.w3schools.com/tags/default.asp) W3C
Markup Validation Service (http://validator.w3.org)
Within this lab, we will attempt to build tables and sections in XHTML. The basic structure of the table
in (X)HTML is divided into rows, with each row consisting of data cells. In addition to traditionally
presenting data in rows and columns, the grid system in tables plays a worthy role in managing the
layout of web based documents.
Lab Objectives
To use tables to define web page layout
To display data in a tabular form in XHTML
To create sections using divisions
To create simple graphical menus using hyperlinks
Lab Requirements
Text Editor: Notepad++ (Recommended) or Notepad
We need a Text editor like Notepad++ to write our HTML code
Web Browser: Mozilla Firefox or Internet Explorer or Google Chrome, etc
A Web browser is needed to view the resulting output of the web page created
USB Flash disk/cloud storage
Please save off all your work onto your external storage device
Notebook or Writing pad
Keep a writing pad handy so that you can note down any important points covered
during the lab class
Lab 3 2/8
XHTML 1.0 Transitional Document Structure
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1 -transitional.dtd">
<body>
Content goes here...
</body>
</html>
Lab 3 3/8
1. Create a copy of the Lab2 folder and rename it to Lab3.
2. Save and extract the lab3files.zip file onto the Desktop
3. Copy all the files from the extracted folder and save them into the images folder in Lab 3.
4. Open a new file in Notepad++ and save it as IS221.html.
5. You will create a XHTML 1.0 Transitional page.
Begin with the basic XHTML document structure. The XHTML 1.0 Transitional DOCTYPE is
given below.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
6. Put IS221 – Web Applications Development as page title.
7. Now create the header section for the IS221 web page using the <div> tag.
Add the <div> tag just after the opening <body> tag.
8. Put an <img> tag to display the usp_logo.jpg image inside the division created.
9. After the USP logo, add IS221 – Web Applications Development as heading 2.
10. Save and view your work in a web browser.
11. Next, add a table to the page with the following specifications:
This will divide the page into two columns. We will use the left column as the menu section and the
right column as the main content area for the page.
3. Save your work and view the result of the code thus far in the browser.
4. Now add two other links to the menu section using the following specs:
Lab 3 4/8
Display Text URL image
USP http://www.usp.ac.fj home.png
XHTML Activity2.html xhtml.gif
Lab 3 5/8
Achieving a 2-Column Layout
In this section you will use a table to divide the page into a two-column layout.
Lab 3 6/8
1. Add a horizontal rule after the end of the main table.
2. Use a division for the footer section. Put a <div>...</div> tag after the horizontal rule.
3. Add another horizontal rule after the division. The horizontal rules will act as "borders".
4. Create the same three hyperlinks inside the <div>...</div> that you created in the
Creating Graphical Menus section.
You can simply copy and paste the code from that section.
5. Ensure that all the links are on the same line. Use can use nbsp; to put spaces between the
links.
6. Verify that your page validates using the W3C's Markup Validation Service. Correct and fix any
errors, if necessary.
Lab 3 7/8
Compare the results of your web page with the screenshot given in the previous section. Ensure that
all the links in the navigation menu are working correctly. Note that you have now successfully
created your very first website!
Lab 3 8/8