This assignment is designed to test your comprehension of the basic CSS selectors we talked about in day one,
Tag selectors, e.g.,
h1 { ... }
Class and ID selectors, e.g.,
div#header { ... }
p.warning { ... }
and
Descendant selectors, e.g.,
div#menu ul { ... }
as well as some of the basic properties and values. This will be done by modifying the CSS Zen Garden’s CSS code.
Note that this quiz is designed to be completed in order.
Navigate to the CSS Zen Garden and download the sample HTML file. (Or you can download it by right-clicking this link.) Open the file in a text editor (refer to the uwwebpub programs page for information on how to download Notepad++) and notice the following HTML:
<style type="text/css" media="all">
@import "sample.css";
</style>
(Note that in CSS day one we had something like
<style type="text/css" media="all">
<!--
@import "sample.css";
-->
</style>
which is “more proper” but is essentially the same.)
Thus, create a file called sample.css and save it in the same folder as the HTML file.
Modify the properties of the body such that
#2A2A2A,#EBE5DC,#A79E8C
and a text color of #8C0B0B and are centered, and#194E76, are not underlined,
and have a white background.body {
color: #2A2A2A;
background-color: #EBE5DC;
font-family: Helvetica,
"Times New Roman",
serif;
}
h1, h2, h3, h4, h5, h6 {
color: #8C0B0B;
background-color: #A79E8C;
text-align: center;
}
a {
color: #194E76;
text-decoration: none;
background-color: #FFFFFF;
}
Important to this section is that you do not modify anything other
than what is specified. All of the below modifications are specified
to be made in the intro (div#intro) section of the document and
should not affect other elements on the page.
Modify the intro section (and only the intro section) such that
(4) will require looking closely at the document tree to see how to isolate only that particular paragraph and not any others.
div#intro {
font-size: 1.5em;
/* notice that this is applied to the *
* div as a whole which is essentially *
* a direct-descendant of the body */
}
div#intro p {
font-size: 0.667em;
text-indent: 2em;
/* text-indent is our first instance *
* where an em means something *
* different than wat it does for *
* font-size. We'll talk about this in *
* day two. */
}
div#intro p.p1 {
text-indent: 0;
}
div#intro div#quickSummary p.p2 {
text-align: center;
}
Note that the final selector
div#intro div#quickSummary p.p2
was perhaps superfluous because the additional information about the
ancestor of div#quickSummary is irrelevant: there can only be one of
them on the page, so why bother specifying that you only want to
select the one that is a descendant of div#intro? We might just as
well have used
div#quickSummary p.p2
as this last selector.
This part of the exercise involves manipulating the three lists at the
bottom of the Zen Garden page. Again, the changes made in Part Three
should not affect any elements outside of the div#linkList section.
(Note that there is an additional, wrapper div surrounding these lists. In particular, the structure is something like
and there is nothing inside of div#linkList2 that is not inside
div#linkList. This is done solely for placement and alignment
purposes. That is to say, your selectors can use either
div#linkList or div#linkList2 without additional consequences. You
could, of course, use both, in the manner of
div#linkList div#linkList2
but this would be superfluous for the same reason as the descendant selector is unnecessary in the solution to Part Two.)
Your assignment is to
div#lselect
Author: Ryan Timmons
Last Modified: 06 August 2008 15:23:13 PDT
URL: http://uwwebpub.com/