Exercise Manual
Exercise Manual
Exercise Manual
4542/MA/A.2/510/A.1
by Steve Lockwood
Technical Editor:
Randy Casburn
© LEARNING TREE INTERNATIONAL, INC.
All rights reserved.
All trademarked product and company names are the property of their respective trademark holders.
No part of this publication may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, electronic,
mechanical, photocopying, recording or otherwise, or translated into any language, without the prior written permission of the publisher.
Copying software used in this course is prohibited without the express permission of Learning Tree International, Inc.
Making unauthorized copies of such software violates federal copyright law, which includes both civil and criminal penalties.
Exercise Manual Contents
© Learning Tree International, Inc. All rights reserved. Not to be reproduced without prior written consent.
4542-MA-i
Legend for Course Icons
Standard icons are used in the hands-on exercises to illustrate various phases of
each exercise.
1. ❏ Action Hint
Checkpoint Stop
Question Congratulations
Information Bonus
Solution/Answer
© Learning Tree International, Inc. All rights reserved. Not to be reproduced without prior written consent.
4542-MA-ii
Login Credentials:
For Course Virtual Machine
During this course, you will be using a Windows virtual machine. The username
and password are documented below for your reference:
Username: user
Password: pw
© Learning Tree International, Inc. All rights reserved. Not to be reproduced without prior written consent.
4542-MA-1
© Learning Tree International, Inc. All rights reserved. Not to be reproduced without prior written consent.
4542-MA-2
Hands-On Exercise 1.1:
Exploring the Complete Solution
Objective
In this exercise, you will browse the complete solution to the course case study
website.
During this course, you will be developing web pages for a fictional
company called Nui Manu Airlines. This exercise allows you to browse a
completed version to see an example of what the pages will look like at
the completion of the couse.
During this course, you have a choice of using many different web
browsers, including Mozilla Firefox, Microsoft Internet Explorer, Google
Chrome, SeaMonkey, and Opera. Feel free to use any browser you are
most familar with, or maybe one you are not familar with.
2. ❏ Under Course Links on the left side, click the link for Complete Solution.
4. ❏ When you are done, your instructor will lead a discussion about the Nui Manu
Airlines website.
5. ❏ Browse the website with a different browser and compare how the site looks to
how it looked in the first browser you used.
© Learning Tree International, Inc. All rights reserved. Not to be reproduced without prior written consent.
4542-MA-3
Hands-On Exercise 1.1:
Exploring the Complete Solution
(continued)
© Learning Tree International, Inc. All rights reserved. Not to be reproduced without prior written consent.
4542-MA-4
Hands-On Exercise 2.1:
Formatting Web Pages With HTML body Elements
Objective
In this exercise, you will begin working on the web pages for your fictional airline,
Nui Manu Airlines. You will use various <body> elements to format a couple of
pages (index.html and whatsnew.html) of Nui Manu Airlines. These pages
currently contain the basic elements to define the structure of the page; you will
add a few elements we discussed, such as <h1> . . . <h6>, <em>, <strong>, <b>,
<i>, <hr />, <p>, and <br />.
1. ❏ Start a web browser of your choice and open the file C:\web4542\exercises
\index.html.
Hint...
To open a file in Internet Explorer, use File | Open and click Browse.
To open a file in Firefox, use File | Open File. To open a file in
Opera or Google Chrome, press <Ctrl><O>.
You will see a first draft of the Nui Manu Airlines home page. Notice that
the page does not yet contain any exciting formatting tags.
To edit a web page, all you need is a text editor. For this course, we
have installed several editors that can be used: Textpad, Notepad++,
Webstorm, and Komodo Edit. There are icons for each on your desktop.
Feel free to explore them all.
© Learning Tree International, Inc. All rights reserved. Not to be reproduced without prior written consent.
4542-MA-5
Hands-On Exercise 2.1:
Formatting Web Pages With HTML body Elements
(continued)
4. ❏ Investigate the contents supplied in the index.html file. The file currently just
contains some basic elements to define the page structure.
Each page in the Nui Manu Airlines website has a <header> that
currently just contains the page name. For consistency, we want to format
each of these page name lines exactly the same in each page. We would
like each of these lines to be formatted as an <h1>.
8. ❏ Locate the text "Aloha! Welcome to Nui Manu Airlines!" inside the <section>
element.
9. ❏ Use the <h2> tag to format the text "Aloha! Welcome to Nui Manu Airlines!"
10. ❏ Save the index.html file, switch back to the web browser, and click the
browser's reload or refresh button.
You should see the text "Home" and "Aloha! Welcome to Nui Manu
Airlines!" formatted as an <h1> and <h2> respectively.
© Learning Tree International, Inc. All rights reserved. Not to be reproduced without prior written consent.
4542-MA-6
Hands-On Exercise 2.1:
Formatting Web Pages With HTML body Elements
(continued)
11. ❏ Open the file whatsnew.html in your browser. This page is used by your airline
to announce new services.
13. ❏ Locate the text "What's New" within the <header> element, and format this text
using an <h1> tag.
14. ❏ Locate the text "Pets Fly Free*" within the <section> element, and format this
text using an <h2> tag.
15. ❏ Save the whatsnew.html file, switch back to the web browser, and click the
browser's reload or refresh button.
Similar to the index.html page, the text "What's New" and "Pets Fly
Free" should be formatted as <h1> and <h2> respectively
A finished version is provided in the C:\web4542\exercises
\solutions\ex21 directory, if you wish to review an example.
16. ❏ Spend a few minutes adding any other HTML elements discussed in the
Course Notes to enhance either of the pages just edited. For example, try using
<strong>, <em>, <hr>, etc.
Hint...
Use your creativity to format the page. Remember that most tags
must be closed (e.g., <strong> . . . </strong>).
© Learning Tree International, Inc. All rights reserved. Not to be reproduced without prior written consent.
4542-MA-7
Hands-On Exercise 2.1:
Formatting Web Pages With HTML body Elements
(continued)
17. ❏ Edit the fleet.html page and add some HTML formatting to the provided text.
Information about the actual aircraft will be added in a later exercise.
Hint...
18. ❏ Test all of your pages in several different browsers and verify that they look good
in each browser.
© Learning Tree International, Inc. All rights reserved. Not to be reproduced without prior written consent.
4542-MA-8
Hands-On Exercise 2.2:
Adding Lists and Hypertext Links
Objective
In this exercise, you will continue to enhance your Nui Manu Airlines website. You
will use ordered lists to number a series of items and add hypertext links to allow
for easy navigation of the site.
1. ❏ If you did not finish the previous exercise, copy all files from the C:
\web4542\exercises\solutions\ex21 directory and place them in the C:
\web4542\exercises directory. Select Yes to All if asked to replace existing
files.
Using lists
In this part of the exercise, you will use ordered lists (<ol>) to format the
steps required to allow your pet to fly free.
3. ❏ Remove the numbers that are hardcoded in front of the steps required to allow
your pet to fly free.
The <br /> tags were adding line breaks after each line, but they are not
needed in a list.
5. ❏ Add the <ol> and <li> tags to format these steps as an ordered list.
Hint...
© Learning Tree International, Inc. All rights reserved. Not to be reproduced without prior written consent.
4542-MA-9
Hands-On Exercise 2.2:
Adding Lists and Hypertext Links
(continued)
<ol>
<li>If you have not already done so, join our popular
<strong>Frequent Flyer</strong> program</li>
<li>Tell all your friends about our great airline</li>
. . .
</ol>
In this section of the exercise, you will add hypertext links using the <a>
tag.
9. ❏ Add an <a href . . . > to link the text "What's New" to the document
whatsnew.html.
Hint...
10. ❏ Save the document and reload the index.html file in the browser.
© Learning Tree International, Inc. All rights reserved. Not to be reproduced without prior written consent.
4542-MA-10
Hands-On Exercise 2.2:
Adding Lists and Hypertext Links
(continued)
13. ❏ At the bottom of the page, add a "Back to Home" hypertext link to allow users to
return to the index.html page. Be sure to place this link before the </body>
tag.
Hint...
15. ❏ Switch back to, or reopen, the whatsnew.html file in the editor. Add a new item
to the ordered list that reads, Tell all your friends about our great
airline. Add this as the second item in the list.
17. ❏ Feel free to add or remove some list items, and notice that the browser now
automatically numbers them.
© Learning Tree International, Inc. All rights reserved. Not to be reproduced without prior written consent.
4542-MA-11
Hands-On Exercise 2.2:
Adding Lists and Hypertext Links
(continued)
19. ❏ In the editor, switch back to the index.html file, locate the following text, and
add the required HTML code to link the text to the specified page:
20. ❏ Test all of your pages in several different browsers and verify that they look good
in each browser.
© Learning Tree International, Inc. All rights reserved. Not to be reproduced without prior written consent.
4542-MA-12
Hands-On Exercise 2.3:
Embedding Images in Web Pages
Objective
In this exercise, you will continue to refine your web pages using both static and
active (linked) images.
1. ❏ If you did not finish the previous exercise, copy all files from the C:
\web4542\exercises\solutions\ex22 directory and place them in the C:
\web4542\exercises directory. Select Yes to All if asked to replace existing
files.
In this first part of the exercise, you will place static images on the web
pages of Nui Manu Airlines.
Hint...
This line should be placed inside the <header> element and before
the line <h1>Home</h1>
© Learning Tree International, Inc. All rights reserved. Not to be reproduced without prior written consent.
4542-MA-13
Hands-On Exercise 2.3:
Embedding Images in Web Pages
(continued)
4. ❏ Save the index.html file and load this page in your browser.
© Learning Tree International, Inc. All rights reserved. Not to be reproduced without prior written consent.
4542-MA-14
Hands-On Exercise 2.3:
Embedding Images in Web Pages
(continued)
In this part of the exercise, you will place an active image on a web page.
8. ❏ Near the end of the document, replace the HTML code similar to the following
(this code was added in an earlier exercise):
with:
<a href="index.html">
<img src="images/home.gif" alt="Fly me back to the home
page" title="Back to home" width="84" height="45"/></a>
Hint...
The "Back to Home" link was added in the last exercise. If you
are missing this link, you must have not completed the previous
exercise. You can either refer back to the previous exercise or just
enter the new link near the bottom of the page.
You will see that the "Back to Home" link has been replaced with a
clickable home image:
Congratulations! You have successfully used both static and active images
to enhance web pages.
© Learning Tree International, Inc. All rights reserved. Not to be reproduced without prior written consent.
4542-MA-15
Hands-On Exercise 2.3:
Embedding Images in Web Pages
(continued)
10. ❏ Add the Nui Manu logo image to the fleet.html page.
11. ❏ Add the Petsflyw.gif image to the whatsnew.html page within the
<section> element.
Hint...
Hint...
© Learning Tree International, Inc. All rights reserved. Not to be reproduced without prior written consent.
4542-MA-16
Hands-On Exercise 2.4:
Using HTML Tables
Objective
In this exercise, you will add a table to a web page. Tables can be used to display
data in a row/column structure.
1. ❏ If you did not finish the previous exercise, copy all files from the C:
\web4542\exercises\solutions\ex23 directory and place them in the C:
\web4542\exercises directory. Select Yes to All if asked to replace existing
files.
This page currently does not contain any information about Nui Manu's
modern fleet of aircraft.
You will now add a table to display information about the four different
aircraft operated by Nui Manu Airlines.
4. ❏ To start the table, place a <table border="1"> tag below the paragraph
describing the fleet.
© Learning Tree International, Inc. All rights reserved. Not to be reproduced without prior written consent.
4542-MA-17
Hands-On Exercise 2.4:
Using HTML Tables
(continued)
5. ❏ Add the appropriate tags to create a table containing the information below.
The aircraft names and descriptions are included within comments in the
fleet.html page. HTML comments begin with <!-- and end with -->. You
can use the text in the comments to save yourself some typing.
Hint...
Remember, the <th> tag should be used for the header rows
and will by default render text in cells as center-justified and bold.
The <td> tag should be used for the table data cells and will
render the text in cells by default as left-justified. Be sure to use
the <tr> tag to start each new row.
6. ❏ End your table by placing a </table> tag at the end of your table data.
© Learning Tree International, Inc. All rights reserved. Not to be reproduced without prior written consent.
4542-MA-18
Hands-On Exercise 2.4:
Using HTML Tables
(continued)
© Learning Tree International, Inc. All rights reserved. Not to be reproduced without prior written consent.
4542-MA-19
Hands-On Exercise 2.4:
Using HTML Tables
(continued)
Hint...
The code for your table should look similar to the following code:
<table border="1">
<tr>
<th>Aircraft Name</th>
<th>Aircraft Description</th>
</tr>
<tr>
<td>Canadair Regional Jet</td>
<td>Twin engine jet. 26.7 meters long with a
wingspan of 21.2 meters. Maximum range of 1500
nautical miles.</td>
</tr>
<tr>
<td>Embraer Regional Jet</td>
<td>Twin engine jet. 33.7 meters long with
a wingspan of 20 meters. Maximum range of 2000
nautical miles.</td>
</tr>
<tr>
<td>Airbus A319</td>
<td>Twin engine jet. 33.8 meters long with a
wingspan of 33.9s meters. Maximum range of 3697
nautical miles.</td>
</tr>
<tr>
<td>Boeing 767</td>
<td>Twin engine jet. 48.5 meters long with a
wingspan of 47.6 meters. Maximum range of 6670
nautical miles.</td>
</tr>
</table>
© Learning Tree International, Inc. All rights reserved. Not to be reproduced without prior written consent.
4542-MA-20
Hands-On Exercise 2.4:
Using HTML Tables
(continued)
8. ❏ Modify the table to contain another column titled "Seating Chart" that displays the
image of the appropriate aircraft. Use the image filenames provided below:
Hint...
© Learning Tree International, Inc. All rights reserved. Not to be reproduced without prior written consent.
4542-MA-21
Hands-On Exercise 2.4:
Using HTML Tables
(continued)
© Learning Tree International, Inc. All rights reserved. Not to be reproduced without prior written consent.
4542-MA-22
Hands-On Exercise 2.4:
Using HTML Tables
(continued)
Hint...
The code for the first two airplanes in the table should look similar
to:
<tr>
<th>Aircraft Name</th>
<th>Aircraft Description</th>
<th>Seating Chart</th>
</tr>
<tr>
<td>Canadair Regional Jet</td>
<td>Twin engine jet. 26.7 meters long with a
wingspan of 21.2 meters. Maximum range of 1500
nautical miles.</td>
<td><img src="images/crj.png" border="0"
alt="Canadair Regional Jet" /></td>
</tr>
<tr>
<td>Embraer Regional Jet</td>
<td>Twin engine jet. 33.7 meters long with
a wingspan of 20 meters. Maximum range of 2000
nautical miles.</td>
<td><img src="images/Emb.png" border="0"
alt="Embraer Regional Jet" /></td>
</tr>
© Learning Tree International, Inc. All rights reserved. Not to be reproduced without prior written consent.
4542-MA-23
© Learning Tree International, Inc. All rights reserved. Not to be reproduced without prior written consent.
4542-MA-24
Hands-On Exercise 3.1:
Adding Style and Structure to Web Pages
Objective
In this exercise, you will investigate the use of style sheets to add structure and
format to the web pages of the Nui Manu Airlines website. Additionally, you will link
a single style sheet to several existing web pages.
1. ❏ If you did not finish the previous exercise, copy all files from the C:
\web4542\exercises\solutions\ex24 directory and place them in the C:
\web4542\exercises directory. Select Yes to All if asked to replace existing
files.
In this first part of the exercise, a style sheet has been provided for you.
This style sheet contains selectors for a few different tags. The style sheet
will be added to each page and then a div tags will be added to the
pages to apply an id selector.
This style sheet defines several selectors to style tags, including: body,
header, section, and footer tags. It also contains an id selector:
#pageWrapper.
© Learning Tree International, Inc. All rights reserved. Not to be reproduced without prior written consent.
4542-MA-25
Hands-On Exercise 3.1:
Adding Style and Structure to Web Pages
(continued)
3. ❏ Investigate the selectors provided in the style sheet and answer the following
questions.
4. ❏ Open the index.html file in an editor, and add the required tag to the <head>
section to link to the nuimanu.css external style sheet.
Hint...
Use the <link> tag and do not forget to close the tag.
5. ❏ Create a page footer by adding the following lines immediately after the
</section> tag:
<footer>
Nui Manu Airlines
</footer>
© Learning Tree International, Inc. All rights reserved. Not to be reproduced without prior written consent.
4542-MA-26
Hands-On Exercise 3.1:
Adding Style and Structure to Web Pages
(continued)
Hint...
© Learning Tree International, Inc. All rights reserved. Not to be reproduced without prior written consent.
4542-MA-27
Hands-On Exercise 3.1:
Adding Style and Structure to Web Pages
(continued)
9. ❏ Switch back to the web browser and reload the index.html file.
You should now see the home page with the page structure and style
sheet formatting applied.
The float property has not yet been discussed, but it is used in the CSS
used here as an example to lead into the next section. If you look in the
selector for the section tag, you will see a float:right. This causes
the entire section element to be "floated" to the right side of its containing
area. Float will be discussed in more detail shortly.
© Learning Tree International, Inc. All rights reserved. Not to be reproduced without prior written consent.
4542-MA-28
Hands-On Exercise 3.1:
Adding Style and Structure to Web Pages
(continued)
11. ❏ Repeat the same steps you just performed to the index.html page to
whatsnew.html. These steps are outlined below for reference:
<footer>
Nui Manu Airlines
</footer>
12. ❏ When you are done, save the file and view in a web browser.
© Learning Tree International, Inc. All rights reserved. Not to be reproduced without prior written consent.
4542-MA-29
Hands-On Exercise 3.1:
Adding Style and Structure to Web Pages
(continued)
Congratulations! You have used style sheets to structure and format web
pages.
© Learning Tree International, Inc. All rights reserved. Not to be reproduced without prior written consent.
4542-MA-30
Hands-On Exercise 3.1:
Adding Style and Structure to Web Pages
(continued)
13. ❏ Repeat the same steps you just performed to the index.html and
whatsnew.html pages to the fleet.html page.
14. ❏ Feel free to add new selectors to the style sheet and apply them to any page or
element. Experimenting with style sheets is the best way to learn.
Several pages for the Nui Manu site are provided for you that already
contain all of the required tags. However, these pages do not yet
contain the link to the style sheet. You will investigate how a page will be
displayed by a browser when the style sheet is not available or even in a
browser that does not support style sheets.
Notice that this page does not contain the link to the nuimanu.css file,
but it does already contain the <div id="pageWrapper"> and the
<footer>. This page also contains a <nav> element that contains a
menu. This menu will be styled in the next exercise.
Even though the page does not have a link to the style sheet, the page still
displays and all of the information is visible. When browsers cannot locate
a style sheet, they perform graceful degradation and display the page in
linear layout.
17. ❏ Switch back to the editor. In the <head> section, add a link to the external style
sheet nuimanu.css.
18. ❏ Save the schedule.html file and reload in the web browser.
The page should now be styled using the id selectors from the style
sheet.
© Learning Tree International, Inc. All rights reserved. Not to be reproduced without prior written consent.
4542-MA-31
Hands-On Exercise 3.1:
Adding Style and Structure to Web Pages
(continued)
The style sheet float property is causing the menu to appear on the left.
The float property has not yet been discussed, but it is used here as an
example to lead into the next section. The menu is displayed on the left of
the browser because the <section> element is floating the content area
to the right.
© Learning Tree International, Inc. All rights reserved. Not to be reproduced without prior written consent.
4542-MA-32
Hands-On Exercise 3.2:
Styling a Navigational Menu
Objective
In this exercise, you will implement the style sheet selectors needed to create a
navigational menu for the Nui Manu Airlines website. Menus are sometimes created
by styling an unordered list as a menu, but in this exercise we will use the HTML5
<nav> element instead.
1. ❏ If you did not finish the previous exercise, copy all files from the C:
\web4542\exercises\solutions\ex31 directory and place them in the C:
\web4542\exercises directory. Select Yes to All if asked to replace existing
files.
In this first part of the exercise, the selectors needed to style a menu will
be added to the style sheet used in the previous exercise.
2. ❏ Open the aboutus.html file in an editor and locate the <nav> element.
© Learning Tree International, Inc. All rights reserved. Not to be reproduced without prior written consent.
4542-MA-33
Hands-On Exercise 3.2:
Styling a Navigational Menu
(continued)
The <nav> element is currently displayed on the left. This is because the
section selector investigated in the previous exercise is floating the main
page content to the right. No other formatting is performed on the menu
because the style sheet does not yet include the required selectors.
This page should look very similar to the All About Us page as it already
contains the <nav> element.
6. ❏ Open the nuimanu.css file in an editor and paste the code just copied at the
end of this file.
7. ❏ This should add the required selectors to style the menu as a vertical menu.
© Learning Tree International, Inc. All rights reserved. Not to be reproduced without prior written consent.
4542-MA-34
Hands-On Exercise 3.2:
Styling a Navigational Menu
(continued)
9. ❏ Switch back to the web browser and reload the web page. Click the links for
Frequent Flyers and All About Us.
The changes just made to the nuimanu.css file have caused all pages
that use the file to be affected. One huge advantage of external style
sheets is that any changes made will affect all pages linking to the style
sheet.
10. ❏ The Home and What's New pages currently do not contain the HTML for the
menu. You will add that now.
12. ❏ Using the mouse, select the entire <nav> ... </nav> element and select Edit
| Copy.
© Learning Tree International, Inc. All rights reserved. Not to be reproduced without prior written consent.
4542-MA-35
Hands-On Exercise 3.2:
Styling a Navigational Menu
(continued)
13. ❏ Open the index.html file in an editor and locate the <footer> element.
14. ❏ Paste the text you just copied before the <footer> element.
16. ❏ Repeat the last three steps and add the menu to the whatsnew.html page.
17. ❏ Test all pages and menu links when you are done.
© Learning Tree International, Inc. All rights reserved. Not to be reproduced without prior written consent.
4542-MA-36
Hands-On Exercise 3.2:
Styling a Navigational Menu
(continued)
The menu selectors have been modified in this style sheet to style the
menu as a horizontal menu.
21. ❏ Open the index.html file that is in the same folder in a web browser.
You should see the menu displayed as a horizontal menu across the top.
© Learning Tree International, Inc. All rights reserved. Not to be reproduced without prior written consent.
4542-MA-37
© Learning Tree International, Inc. All rights reserved. Not to be reproduced without prior written consent.
4542-MA-38
After-Course Activity--Sandbox:
Formatting Additional Pages
Objectives
During this exercise, you will use the knowledge gained in the course to format a
few additional pages to look similar to the pages created during the course.
Overview
© Learning Tree International, Inc. All rights reserved. Not to be reproduced without prior written consent.
4542-MA-39
After-Course Activity--Sandbox:
Formatting Additional Pages
(continued)
3. ❏ Click the browser's Back button and click on another island in the map.
© Learning Tree International, Inc. All rights reserved. Not to be reproduced without prior written consent.
4542-MA-40
After-Course Activity--Sandbox:
Formatting Additional Pages
(continued)
4. ❏ Add the required HTML to the following pages to format them like all the other
pages of the Nui Manu site (as you did in the course):
bigisland.html
kauai.html
lanai.html
maui.html
molokai.html
oahu.html
You can look at any of the other HTML files in the folder as an example
of what needs to be done. There is also a solution to this exercise in the
solutions folder.
Following are screen shots of how a couple of the pages may look when
done:
© Learning Tree International, Inc. All rights reserved. Not to be reproduced without prior written consent.
4542-MA-41
After-Course Activity--Sandbox:
Formatting Additional Pages
(continued)
© Learning Tree International, Inc. All rights reserved. Not to be reproduced without prior written consent.
4542-MA-42
After-Course Activity--Sandbox:
Formatting Additional Pages
(continued)
© Learning Tree International, Inc. All rights reserved. Not to be reproduced without prior written consent.
4542-MA-43
© Learning Tree International, Inc. All rights reserved. Not to be reproduced without prior written consent.
4542-MA-44