Lab 12
Creating a Simple Web Page
Due: Wednesday, May 7th
40 points
For this lab you will create a simple web page containing basic HTML elements, including pictures, lists and hyperlinks. The goal for this lab is for you to become familiar with the HTML markup language.
Web pages are text files. All the fancy graphics, flash animations and movies one can view on the Web are controlled, in fact, by a simple text document. This simplicity allows virtually anyone to create his or her own web site with relative ease.
Your Web page must include all of these these elements:
Additionally, your web page must include the following
For extra credit (5 points), you can include a table with at least three rows and two columns. Every cell in the table must have content.
You will need to use your UNIX account to prepare for loading your website onto ub or bulldog later on. To ensure that everything works correctly, follow these steps:
login:prompt will appear.
enter
.password:prompt will now appear.
enter
.u UNIXoption from the umenu system by pressing
u
on the keyboard, then press
enter
.bulldog3.d.umn.edu%
cd wwwand press
enter
to change
from your home directory to your Web directory.lsand press
enter
to see what
files are contained in your Web directory.exitand press
enter
to leave the UNIX system.Your account is now ready to receive HTML and image files for your website. You will need to repeat these steps later on, so remember where you saw them.
To create a web page we will use the simple text editor NOTEPAD. You can find this program under the Start->Program Files->Accessories menu. When you open the program, you should be presented with a blank page.
A web page has 3 main parts:
html
section.head
subsection.body
subsection.
All of the content in a web page is described within the
body
subsection, however both the html
and
head
section are required for a web browser to understand
your web page properly.
Each of these sections are delimited by tags. A tag is some word enclosed within a set of square brackets (<>). The tags for each of these sections are:
html
tags: <html> </html>head
tags: <head> </head>body
tags: <body> </body>The tags which start with the '/' character are called closing tags and let the web browser know when a section ends.
This is the first part of your web site and is required. In your blank document type:
<html>
</html>
These tags denote the beginning and end of the HTML file. All the
content for the web page goes between these two html
tags, including both the head and body subsections.
head
and body
Subsections
Every web page contains head
and body
subsection. The head
section defines variables and
elements of the web page which do not appear in the page. The
body
section contains elements that will appear in the
web page.
Type the following between the two html
tags.
<head>
</head>
<body>
</body>
Your document should now have the head
and
body
tags enclosed within the html
tags. Like this:
<html>
<head>
</head>
<body>
</body>
</html>
You have now created a bare minimum web page. If you upload this page to your school account and view it in a web browser you would see a blank page. Not very interesting.
Now you need to add content within the head and body subsections. The various tags you will need to use are described in the section "HTML Tag Reference" below.
A detailed HTML tag reference may be found at http://www.htmlhelp.com/reference/html40/olist.html
Now that you have created your web page, you will need to upload it, along with any pictures, to your account on bulldog or ub. To do this, we will use the WS_FTP client which can be found on all lab machines. To upload your files, follow the following sequence.
Congratulations! Your web site should now be functional. To view it, open a web browser and go to http://www.d.umn.edu/~username/ (where username is your login name). If everything has worked correctly, your web page should appear.
Once your webpage is visible in the web browser, print out a copy. The webpage should have all required elements clearly visible. Make sure your name appears on the web page as well. Turn it in with a cover sheet as usual.
These are the tags you will need to learn about to implement each of
the options above.
<title>Your title</title>. The
title
tags can only appear within the
head
subsection, all other tags must appear within
the body
subsection. This tag puts a title for your
Web page in the title bar of the browser.
<img src="filename">to add a picture to your web page.
<a href="web address">link text</a>adds a link to the website web address where the clickable content is link text. Note that link text could be an image.
<ul>, </ul>
<ol>, </ol>
<li>followed by the text you want to go with that tag. The list item tag does not need a closing tag, but you can include one for completeness. Once you are done with the list you add the appropriate ending tag (either </ul> or </ol> matching what you started the list with).
<div align="left">right
<div align="right">or center
<div align="center">
<hn>your text</hn>where n is 1, 2, 3, 4, 5 or 6 creates a section header. The closer the number is to 1, the larger the text will be.
<hr>draws a horizontal line across the page (see the top of this document).
<font color="#colorCode">your colored text</font>to color the text "your colored text". colorCode must be a six digit hexadecimal number specifying the amount of red, green, and blue in the color you want. Here is a page that shows the codes for several colors.
<title>your page title</title>where your page title should be appropriate for your web page. Remember, this tag goes in the head section of your Web page.
mailto:somebody@somewhere.edu
for "web address".This is an absolute bare-bones HTML file. You may use it as a starting point or as a check against your own work.
<html>
<head>
<title></title>
</head>
<body>
</body>
</html>
Click on this link to view a page which contains all of the elements we have talked about. You can see the HTML code by choosing View->Source or View->Page Source in you web browser.
Q: I don't know what my "login name" is!
A: Your login name should be identical to your email name. The part before the '@' in <your_name>@d.umn.edu is your username.
Q: I don't know what my password is!
A: Your password is the same one you use when checking your email. If you have never checked you email on the university system before, you will need to go to the Library and get a temporary password there.
Q: I get a message saying "Forbidden" and that I don't have permissions to access the file in my web browser when I try to access my webpage
A: You do not have file permissions set correctly. Even though it is your file, when a web browser attempts to load it, the browser appears as "somebody else". To set the proper permissions, you must be logged in to your UNIX account. See instructions above. Once logged in, and at the UNIX command prompt, move to your web directory by typing
cd ~/www
followed by enter
on the UNIX command line. Now change
the permissions on the file "index.html" by typing
chmod 644 index.html
followed by enter
.
Q: My webpage loads, but my pictures do not
A: First, check that you have spelled the names of your pictures properly in your <img> tags. If they are misspelled, then the web browser will not be able to locate them. Note that file names are case sensitive.
Second, the permissions on the pictures may be incorrect. To fix
this, follow the instructions above for setting correct permissions on
the index.html
file, but substitute your picture's
filename for index.html
.
Alternately, you can set all the file permissions at the same time with only one command. First move to your web directory (if you are not already there) by typing
cd ~/www
followed by enter
. Now type
chmod 644 *
followed by enter
. This will give everybody permission
to read (but not to change nor delete!) all of the files in your web
directory.
Q: Only part of my webpage shows up and I know I've typed everything in!
A: Make sure that you have closed all of your brackets. Every '<' must have a matching '>'. Also, some tags require a closing tag (which is different than a closing bracket). for instance, the Bold tag, <strong>, needs a closing tag, </strong>, to know when to turn off bold text. Every closing tag is the same as the opening tag except with the character '/' prepended.
Check the online HTML guide to check if your tags require a closing tag.
Official HTML 4.01 specification: http://www.w3.org/TR/html401/
Quick List of web tags: http://www.htmlhelp.com/reference/html40/olist.html