Web Programming

CSC 210, Spring 2011

(Monday and Wednesdays, 2:00-3:15pm in CSB 209)

Submit At my.rochester.edu

Assignment #1

This assignment tests your understanding of basic XHTML and CSS.

Contact Assignment

Your contact for this assignment is Bradley Halpern. Please direct questions about this assignment to Bradley (see the Contact Page) because he will best know what's going on. You can also always contact Jeff, who may end up forwarding your question to Bradley.

Securing Your Assignment

Starting with this assignment, you are required to secure your content from prying eyes. This is mainly so students at other schools who might also be doing this assignment can't see your solutions. You should also not look at the assignments from your classmates (even if you figure out how) - although we trust (most of) you, we will still check!

For this assignment, you'll use an .htaccess file to protect your pages. .htaccess files can do all sorts of neat stuff, but we'll use them to set up a required username/password for your web site. You should set up your web site so it asks for a password before you start putting your assignment files up on the web. Make sure you submit your assignment with the username/password created (so we can access your pages). Followings are the steps about how to use .htaccess file to set a password for your web site:

You'll be securing your entire web directory with .htaccess (keep it around for future assignments).

Use the instructions from Assignment 0 to login to the server betaweb.csug.rochester.edu, and create the following two files:

You can put .htpasswd to any other directory. No mater where you put it, make sure you specify the correct directory path of .htpasswd in .htaccess. The form of content in .htpasswd is "username:enc(password)". The password is encrypted in the file. Note that "user:eBPHuu8YopIkg" is just an example, you need to create your own. For instance, for the username "tpain" and the password "onaboat" the file would read "tpain:eHJnPWaCPHwss". You can get the encrypted form of password from here or follow instructions for a program already on the instructional server called htpasswd to create the file and encrypted password for you.

Before continuing, visit your web page on the instructional server and make sure that it asks for the username/password that you set up.

Assignment Requirements

You will create several files related to a recipe web site for a fictional pie company named Granny's Pies. You need to turn in the following files:

The first part of your task is to create a front page (README) for this web site, stored in a file named index.html. Your front page must contain a link to pie.html. The file must also be at least 20 lines long and must contain at least 4 different XHTML elements in its body. It also may not significantly borrow content from your pie.html. Otherwise, this front page can have any appearance you like. If you like, you may use an optional CSS stylesheet with this page named index.css and submit it with your other files. Be creative! We may show some students' pages in class on future dates.

The second (and more substantial) part of the assignment is to recreate a specific web page describing a recipe for lemon meringue pie, stored in a file named pie.html. Unlike index.html, this page is rigidly specified and must exactly match the appearance specified in this document.

For full credit, your files must be uploaded to our web server and must match several stylistic guidelines, all specified in the following sections.

Expected Appearance:

You must match in appearance the following pie web page (click the screenshot below to see the full size image). The width of the full size screenshot is based on a browser window width of 1024px; if your screen is a different size, the width of your page may not exactly match. Any line breaks are done automatically by the browser, except ones that are clearly much narrower than the page width, such as the line "One 9-inch pie":

expected output
click for a full-resolution view

Appearance and Behavior Details:

All headings on the page should use a foreground color of (red=164, green=164, blue=0) or #A4A400 and a background color of (red=240, green=240, blue=240) or #F0F0F0. The font families for headings are Century Gothic, Futura, Verdana, or any sans-serif font available on the system. The page's main heading is aligned to the center of the page body, and uses a 22pt bold font. Other headings on the page are left-aligned and appear in an 18pt normal font. All headings should be underlined.

The overall page's body should have a white background. Text in the body should have a foreground color of (red=64, green=64, blue=64) or #404040 and use an 11pt font. The font families for page text are Georgia, Garamond, or any serif font available on the system. Any links on the page should use the color (red=164, green=164, blue=0) or #A4A400, matching the color of the page headings.

The names of the four major steps of the recipe directions (such as "Preheat Oven") are formatted in a strong font. The quotations from the users appear in an italic font as indented blocks with background color (red=255, green=255, blue=200) or #FFFFC8. The picture of the pie on the page and the W3C validator images at the bottom come from the following image files, respectively:

All other decisions about styling on the page are left to the web browser. Any styles mentioned previously that are the same as browser defaults do not have to be explicitly included in your CSS stylesheet. The screenshot in this document was taken on Windows XP using Firefox 2.0, which may differ slightly from the appearance on your system.

The bottom of the page has four links. The "Home" link should link to your index.html page. Use a relative URL and assume it is located on the same web site as pie.html in the same directory. The "Search for other lemon meringue pie recipes" text, the "W3C XHTML 1.1" button, and the "W3C CSS" button should link to the following web pages, respectively:

The pie web page's title text should be Grandma's Lemon Meringue Pie.

Fortunately, you don't need to type all the text contents about how to make the pie. Here is the file (output.txt) containing all the text contents of the page without XHTML or CSS markup. This file is generated by simply using "Select All", "Copy" in the page, and "Paste" in the text editor. Note that this copies images' alt attributes in place of the images, and copies * in place of bullets on bulleted lists.

Extra Features:

Please also complete *all* of the following additional requirements in your pie page. These are features that may have not been covered in detail in lecture; the idea is that you will have to explore your resources such as your textbook, lecture slides, or online references to learn how to complete these features.

  1. Background: Set the overall page to use a background image of http://www.cs.rochester.edu/u/jbigham/courses/210/assignments/1/silverware.jpg (use absolute URLs to link to all images). The image should repeat in both directions across the page and should not move when the page is scrolled.
  2. Favicon: Set the page to have a "favorites icon" ("favicon") of http://www.cs.rochester.edu/u/jbigham/courses/210/assignments/1/pie_icon.gif (use absolute URLs to link to all images). Instructions for favicons are found in Chapter 3 of the textbook. The favicon will not work properly in Internet Explorer; you may ignore this.
  3. Pie bullet: Set all bulleted lists of items on the page to use an image for their bullet icon rather than the normal black circle. Use the image of http://www.cs.rochester.edu/u/jbigham/courses/210/assignments/1/pie_icon.gif (use absolute URLs to link to all images).
  4. Wide headings: Widen all headings on the page by placing 0.2em of horizontal spacing between neighboring letters in all headings.
  5. Borderless image links: Get rid of the yellow borders around the W3C images at the bottom of the page.

Near the top of your HTML file, put a comment saying which extra features you have completed.

As much as possible, you should implement these changes by modifying your CSS code rather than your HTML. Some of the CSS properties necessary will not have been covered in class, so you must learn them yourself. Try using the textbook, Google, or looking at a CSS property reference such as the following site:

A screenshot of the expected output for the extra features is as the following. The screenshot in this document was taken on Windows XP using Firefox 2.0, which may differ slightly from the appearance on your system. You can click the screenshot below to see the full size image.

expected output with extra features
click for a full-resolution view

Implementation and Grading:

Implement your pie.html web page using XHTML 1.1 as taught in class. For full credit, your page must successfully pass the W3C XHTML 1.1 validator with no errors (a green bar). (It is okay if the validator says your page is "tentatively" valid or has warnings, as long as you see the green "Valid" bar in the validator.) You should choose appropriate HTML tags to match the structure of the content being displayed on the page. Do not express stylistic information in the HTML page itself, such as inline styles or presentational HTML tags such as b or font. You may not use HTML tables in your pie recipe page.

You only need to worry about the appearance of your page in standards-compliant web browsers such as Firefox. Your pages will not be tested in any way in Microsoft Internet Explorer or other browsers that do not comply to web standards.

Express all stylistic information on the page using CSS defined in recipe.css. For full credit, your style sheet must successfully pass the W3C CSS validator. Part of your grade comes from expressing your CSS concisely and without unnecessary or redundant styles. Outside of extra features, do not use HTML or CSS constructs that have not been discussed in lecture or the slides, through Chapters 2-3 of the textbook.

Though they will not be discussed until after the homework is assigned, you may know about using class and id attributes to target HTML elements for styling. Do not overuse such attributes in your HTML unnecessarily. If there is already a suitable tag for representing a given piece of content, favor the use of that tag rather than a less appropriate tag with a class or id attached for styling purposes.

Format your HTML and CSS nicely so that it is as readable as possible, similarly to the examples shown in class. Also place a comment header in each file containing your name and section and a brief description of the assignment and the file's contents. You must properly use whitespace and indent your XHTML and CSS code following examples shown in class. To keep line lengths manageable, do not place more than one block element on the same line or begin any block element past the 100th character on a line. For reference, our solution has 118 lines of HTML and 36 lines of CSS, though you do not need to match this exactly.

The majority of the points for this assignment will be for the pie.html and its recipe.css files. The index.html will also be graded, but it will be worth fewer points. The main stylistic constraint on your index.html file is that it should pass the W3C XHTML 1.1 and CSS validators. Beyond that it can contain any non-obscene content you like, even content that uses material we have not yet learned in lecture. Please do not link to external resources (other than image files or index.css) from your index.html page.

Submit your assignment online from the turnin link in the Homework section of the course web site. Turn in both .html files and your .css style sheets. You do not need to turn in the provided images. If your index.html page includes images linked using absolute URLs, you do not need to turn in those images.

Part of your grade will also come from successfully uploading your files to the web server. You should place your files into your public web space in a subdirectory named 1, so that it is possible to navigate to your page by entering the following URL into the browser:

If your page is not available at exactly this URL (case-sensitive), you may not receive credit for this part of the assignment. To turn in your program, you must submit the URL and username/password used to access it by using Blackboard as stated previously. Students who upload files to web server but do not turn them in may not receive any credit for their work.

Please do not place a solution to this assignment online on a publicly accessible web site. Doing so is considered a violation of our course academic integrity policy, so make sure your web site is asking for a password before you start putting your assignment files up on the web. Also make sure you submit your assignment with the username/password created.

Extra Credit

As usual, there are some extra credit opportunities this week, including your first change to earn a bell! And, lucky for you, in addition to being an excellent learning opportunity, the bell looks quite tasty. As usual, the page you turn-in should be a web page that describes what you did and links to your submission (and any extra credit options).

Props

This document's contents are (C) Copyright 2009
Marty Stepp / Jessica Miller and licensed under Creative Commons Attribution 2.5 License.
It's been changed and adapted to the UofR by Jeffrey Bigham and Zhuan Chen.

Please email Jeffrey P. Bigham at jbigham@cs.rochester.edu with questions.

Valid XHTML 1.0 Transitional Valid CSS!