CS/CIS 330 Spring 2004,
Homework 1b:
Cascading Style Sheets
(CSS)
This assignment is due on February
9 at 23:59pm via the
course management system. You must perform this assignment individually; groups
are not permitted.
Project
Description
In
this homework assignment, you are asked to create a CSS file for an website
that we provide. You will also need to
modify parts of each HTML page provided so that it references the stylesheet. The focus of the assignment is to get you
familiar with some of the HTML tools you will have at your disposal when
designing dynamic content web pages later on in the semester.
CSS StyleSheets
Cascading
Style Sheets (CSS) is relatively new technology that has been shown to be quite
powerful and useful in practical web development. A cascading stylesheet is reference file for
text, layout, and spacing multiple HTML pages share that allows for simpler and
cleaner HTML design, as well as easier updates and modifications of existing
web pages. Most modern browsers
including IE5 and Netscape7 support CSS.
Please refer to http://www.w3.org/Style/CSS/
for more information on browser support.
Part 1:
The Basics
CSS
can be embedded in the header of an HTML page, or referenced as a separate
file. For the purposes of this
assignment, we want you to write the stylesheet as an external file. For the HTML page to use the stylesheet, you
simply need to declare so in the header of the HTML document with the line:
<link
href="style.css" type="text/css" rel="stylesheet"/>
For
this declaration, the web browser will assume that a CSS file called style.css
exists in the same relative location as the HTML file. The path to the CSS file can be relative or
absolute, but for this assignment we require you to use the relative link as
above. You can create a very simple
stylesheet with a browser containing the following information:
body {
background-color: #FFFFFF;
color: #000000;
font-size: 10pt;
font-weight: regular;
font-family: serif;
}
a:link {
color: #FF0000;
text-decoration: none;
}
a:visited {
color: #FF0000;
text-decoration: none;
}
a:active {
color: #FF0000;
text-decoration: none;
}
a:hover {
color: #FF0000;
text-decoration: underline;
}
.sidebarText {
text-align: center;
font-size: 12pt;
font-family: Verdana;
color: #009900;
}
a.sidebarText:link {
color: #009900;
text-decoration:
underline;
}
a.sidebarText:visited {
color: #009900;
text-decoration:
underline;
}
a.sidebarText:active {
color: #009900;
text-decoration:
underline;
}
a.sidebarText:hover {
color: #009900;
font-style: italic;
text-decoration: underline;
}
With
the exception of the ‘sidebarText‘ class, the declaration
is consistent with the information you would normally set in the <BODY>
of an HTML page. Sections are divided
into Classes, like the ‘sidebarText‘ class, and always
begin with a period and the title of the class with brackets enclosing the
class information. The four segments
after the ‘sidebarText‘ class declaration define
what to do for links that reference this class.
Note that these segments override the normal link behavior. They do not, and often should not, be set for
all classes since you have the default linking behavior to go on.
In
this example stylesheet, HTML pages that reference it would have black ‘serif’
text with a white background, and links in red that become underlined only when
you dragged your mouse over them. The
sidebar would use the ‘Verdana’ font in green letters. If there were any links in the sidebar that
referenced the class they would always be underlined in green and become italicized
when you dragged your mouse over them.
If
you are new to HTML colors, there are a set of 216 web-safe colors you are
expected to use for this assignment and in the real world of web design. They are all made up of a 6 hexadecimal
string that is represented as #RRGGBB where RR is the red component, GG is the
green component, and BB is the component.
Each component can be one of six values listed here in increasing strength: 00, 33, 66, 99, CC, FF. So if you wanted the brightest pure blue
possible you would use #0000FF. For white,
you would use #FFFFFF. Or for a mix of
blue and red you would use #990099. If
this is too confusing, there are plenty of lookup tables on the web you can use
to pick your colors. You are not permitted to use colors like
#0323EE since these are not considered web-safe.
Now
that we have set you up with the basics, we expect you to use the vast
resources of the web to help accomplish the rest of the assignment. There are plenty of pages and tutorials on
CSS that you can go to for help. Exactly
how you go about modifying the page is up to you, for example what class names
your CSS will have, but it must conform to the following guidelines:
<link
href="style.css" type="text/css" rel="stylesheet"/>
You do not need to use the link index.html since that is a frame
file that does not require a stylesheet.
Part 2:
FictionBooks.com
FictionBooks.com
is in the process of creating a new layout for their website. They have written a very simple HTML design
using frames and want you to create a new CSS for it as well as modify the HTML
pages to fit the CSS. Their
specifications are as follows:
When
complete, your version should look something like:

Afterwards,
compare the website with the original you started with and notice how different
the page looks with very little change to the actual HTML page. That is part of the power of CSS.
What to
Submit
In a zip file called A1b.zip submit:
Like
all assignments, you must submit your solutions via the course management
system. Last year, many students waited till the last minute to
get their account set up. Unless you are a late arrival to the class whose
account might not be set up in time, no assignments will be accepted by TA's
via e-mail. Please contact a TA at least 24 hours before an assignment is due
if you are experiencing technical difficulties so that we can be sure to get
back to you in time.