Assignment Module W23k

Creating XHTML Links


Overview

You'll be creating two Web pages with links in this assignment. The links will be both within the document and to files on other Web sites. You'll be opening the files both in the current window and in new windows.


Task 1


to Top

Task 1 thumbnail
Screenshot of Task 1 (top of page only) is available (Opera 7.54 at 80%)

to Top
  1. Save your XHTML template file as w23k-sample1.htm, and title the page, "Sarah Strong Links 1" (changing Sarah Strong to your own name). Make sure your name is also listed as author.
  2. Open text file w23k_sample1.txt, select it all, and paste it into the body of your document.
  3. The first three lines of the text are headings. Add appropriate markup.
  4. Under the heading "TABLE OF CONTENTS" is a series of lines representing the main headings in the document. These should be make into an unordered list and linked to named anchors in the document, so that the reader can click on any entry in the Table of Contents, and go to the corresponding location. Here is a sample of what the code for one entry would look like:
    <li><a href="#etexts">About Etexts</a></li>
  5. Each of the headings to be linked from the Contents is marked with a tilde ~ before and after, like this:
    ~ About Etexts ~
    When you find a heading like this, you should put in appropriate markup, remove the tildes, and add a name anchor, like this:
    <a name="etexts" /><h3>About Etexts</h3>
  6. In addition to the name anchor, put in a link back to the top of the document under each internal heading. The link to the top could look like this:
    <p style="font-size: 80%">Return to <a href="#top">beginning</a> of document</p>
    To make this work in all browsers, you will need to create an anchor with the name top right after the <body> tag. If you don't, the links will not work in Netscape 7.x or Opera (though they will work in Netscape 4.x and IE).
  7. Finally, all text below the Table of Contents that is not part of a heading should be separated into paragraphs with <p> </p> tags as shown by blank lines in the text.
  8. Check the text in a browser and make sure it looks right. Check each link in the contents, and each link back to the top of the page. Troubleshoot and repair any that don't work.
  9. Validate your page with the W3C validation service.

 

Task 2


to Top

Task 2 thumbnail
Screenshot of Task 2 top of page with Georgraphy and History windows open below (Opera 7.54 at 80%)

to Top
  1. Save your XHTML template file as w23k-sample2.htm, and title the page, "Sarah Strong Links 2" (changing Sarah Strong to your own name). Make sure your name is also listed as author.
  2. Copy the following text and paste it into the body of your document:
<!-- Heading Level 1 -->
UP FROM SLAVERY

<!-- Heading Level 2 -->
by <!-- Link to site about Booker T. Washington; open in window called "history" --> Booker T. Washington

<!-- Heading level 3 -->
Chapter I. A Slave Among Slaves

<!-- new paragraph starts here -->
I was born a slave on a plantation in
<!-- Link to site about Franklin County, VA; open in window called "geography" -->Franklin County,
<!-- Link to site about the state of Virginia; open in window called "geography" -->Virginia.
I am not quite sure of the exact place or exact date of my birth,
but at any rate I suspect I must have been born somewhere and at
some time. As nearly as I have been able to learn, I was born
near a cross-roads post-office called
<!-- Link to info about Hale's Ford, VA; open in window called "geography" -->Hale's Ford,
and the year
was 1858 or 1859. I do not know the month or the day. The
earliest impressions I can now recall are of the
<!-- Link to historical info about the southern plantation system; open in window called "history" -->plantation
and the slave quarters--the latter being the part of the plantation
where the slaves had their cabins.

<!-- new paragraph starts here -->
My life had its beginning in the midst of the most miserable,
desolate, and discouraging surroundings. This was so, however,
not because my owners were especially cruel, for they were not,
as compared with many others. I was born in a typical log cabin,
about fourteen by sixteen feet square. In this cabin I lived with
my mother and a brother and sister till after the
<!-- Link to site about the US Civil War; open in window called "history" -->Civil War,
when we were all declared free.

<!-- new paragraph starts here -->
Of my ancestry I know almost nothing. In the slave quarters, and
even later, I heard whispered conversations among the coloured
people of the tortures which the slaves, including, no doubt, my
ancestors on my mother's side, suffered in the
<!-- Link to site about bringing slaves to America; open in window called "history" -->
middle passage
of the slave ship while being conveyed from Africa to America. I
have been unsuccessful in securing any information that would
throw any accurate light upon the history of my family beyond my
mother. She, I remember, had a half-brother and a half-sister. In
the days of slavery not very much attention was given to family
history and family records--that is,
<!-- Link to info about African-American geneology; open in window called "history" -->black family records.
My mother, I suppose, attracted the attention of a purchaser who was
afterward my owner and hers. Her addition to the slave family
attracted about as much attention as the purchase of a new horse
or cow. Of my father I know even less than of my mother. I do not
even know his name. I have heard reports to the effect that he
was a white man who lived on one of the near-by plantations.
Whoever he was, I never heard of his taking the least interest in
me or providing in any way for my rearing. But I do not find
especial fault with him. He was simply another unfortunate victim
of the institution [of
<!-- Link to site about slavery in the US; open in window called "history" -->slavery]
which the Nation unhappily had engrafted upon it at that time.

  1. Comments in the text inform you what to do. Specifically,
    • <!-- Heading Level 1 --> as well as levels 2 and 3 tell how the next line should be formatted.
    • <!-- new paragraph starts here --> indicates where to put paragraph start tags. (You are responsible for putting in the corresponding end tags.)
    • <!-- Link --> indicates where links should be created. You will need to do a little research for each one, using search engines. You may link these words to any appropriate Web page.
  2. View your page in a browser, making sure the headings and paragraphs are formatted as specified.
  3. In the browser, check each link to make sure it takes you to the appropriate site and shows in either the "history" or "geography" window. (Recall that the window doesn't display this name anywhere, but historical references should open in one window and geographic references should open in the other.)
  4. Validate your page with the W3C validation service.
Submitting the Assignment

to Top
to Top

When you're done, double-check that the assignment meets the specifications above, and that all links are functional.

Upload to your work to your WCC student Website, and send email to the instructor with the URI. Be sure your email meets the formal requirements: name, class, section and exercise (W23k), and that it follows standard business-email practice.

 


to Top About This Document
Audience

to Top

This exercise is for people who are familiar with the concept of links in XHTML (see module W23c) and are ready to practice.

Objectives
to Top

On successful completion of this module, you will be able to:

  1. Create links to internal document anchors;
  2. Create absolute links to documents in other directory structures;
  3. Create anchors in a document;
  4. Open links in a new window.
to Top
Module W23k: Creating XHTML Links
This document is part of a modular instruction series in Computer Instruction. For more information, see the overview or the list of modules in this series, W: World Wide Web. This document has been used in the following classes: INP 150.
History

Original: 6 October 2003
Last modification: Thursday, 18-Nov-2004 21:45:17 EST
Copyright
Copyright © 2003, Laurence J. Krieg, Washtenaw Community College
Instructors: You may point to this file in your Web-based materials; however, its location may change without notice.
Students: You are welcome to make a copy for your personal use.
All other uses: Please contact the author, Laurence J. Krieg, for permission: krieg@ieee.org.