In this lab, you'll make an a complete web site for "[Your Name]'s Pet Shop." That is, your site will have more than one page of content on it, navigation links, and a consistent site look. More importantly, we will also concentrate on making sure that the page verifies as XHTML Strict. If you follow good coding practices and have paid attention in class, this will be easy. If not, it may be a bit of a pain.
You've already shown that you know how to add content to pages in your past labs. Due to time constraints, each page will have only a minimal amount of content on it. Obviously, if you were doing this page for a real company you would add much more content. The focus is on you showing that:
On a few of the more difficult / newer steps, I've included tips on how to do it. Whenever you see a little footnote icon like this one here1) just hover your mouse over it to see the hint. Additionally, all the footnotes are placed together at the bottom of the page. So, don't scroll down and view all the footnotes together at once. If you do, you probably won't learn as much as if you tried things on your own.
You should make two copies of the XHTML/CSS template. Name the copies:
Additionally, make a blank text file named something to the effect of petshop.css. In Notepad++ you can do this by clicking File, New, and then saving the new file with the name "petshop.css"
To create a consistent look across sites, you'll want to modify each page to use an external CSS file. So, on each page remove the style element (and its content). Now, instead put this somewhere in the <head> element:
<link rel="stylesheet" type="text/css" href="petshop.css" />
This will cause the browser to download petshop.css in order to find out how the site should look. So now, both pages will share the same look.
Remember how I said that we shouldn't use tables for navigation / website layout? Well, too bad because we're going to use tables until we learn something better. On one of the pages, add the HTML to make a table that looks something like this (you'll have to set the colspan attribute in some places):
_____________________ | Current Page Name | |_____________________| | lnk1 | Your content | | lnk2 | will go in | | | here! | |______|______________| | Phone#+Address+Hours| |_____________________|
Be sure to give your navigation table an id of "navtable"2). We'll use this to give it a look different from other tables later.
On the left hand side (where it says lnk1, lnk2) make an unordered list whose items are links to the various pages (index.html, pets.html). For this list, give it an id of "navlinkslist". Now put the "Current Page Name" part in <h1> tags and the "Your content will go in here!" part in a <p> tag.
By default, the browser may try to keep all the data centered vertically. So, when you (eventually) add lots of content the navigation links will no longer be at the top of the page. Fix this by setting the valign attribute for the navigation td element to the value "top"3).
Make up a fictional phone number, address, and hours of operation and place it in the appropriate table section. Put it in a <p> tag whose id is "footer".
This HTML will be your template, kind of. Copy and paste this HTML into the other .html file you've made, so that each page has a consistent layout and all you'll need to do is change the content of each h1 tag to match what that page is about, and then add content.
Each bullet point should be a separate paragraph. It can be a very short (1 sentence) paragraph.
Do this section as quickly as you can, to leave ample room for the CSS section.
For the index.html page's content (which will be inside a piece of table cell):
For the pets.html page:
___________________________ | Pet Type: | Guarnt. | $$ | |___________________________| | pet type1 | 7 days | $5 | |___________________________| | pet type2 | 14 days | $15 | |___________________________| | pet type3 | 30 days | $50 | |___________|_________|_____|
It's time now to go back and open up the site's CSS file. You can do all of this by ONLY editing the CSS file (assuming you followed the directions above).
When choosing a site color theme, pick one that makes sense. For example, a patriotic colored pet shop, or one using bright bold colors (greens and blues, for grass and sky?) makes sense. One using dark dull greys and blood red text would not be a good choice.
Do the items in the order that they are listed.
I've placed some images in this directory. Go ahead and browse them and pick out a few you want to use in your web page. There's no need to copy them to your own directory. Just reference them by specifying the full URL to them (e.g., http://www.cs.pitt.edu/~rmoore/cs134/petshop/2rabbits.jpeg).
Many of them are very large. I've not resized them so that you can be creative and use whatever size you want for your page. So for example, you can do <img src="whatevergoesinhere" alt="whatev" width="200" height="200" />. In a real website, you would resize the images using a photo editor or some such, in order to reduce the download size.
All images are in the public domain.