HTML and CSS Reference
Go to the end of the
book for a full color
version of this figure
Hands-On Practice Case
Create a folder called javajamcss. Copy all the files from your javajam folder into the
1. The External Style Sheet. Launch Notepad. You will create an external style sheet
named javajam.css. Code the CSS to configure the following:
● Global styles for the document background color (#ffffcc ), text color
(#330000 ), and Verdana, Arial, or any sans-serif font
● Style rules for the h1 selector that configure background color ( #ccaa66 ), text
color ( #000000 ), 200% line height, and centered text
● Style rules for the centered navigation area (use an id named nav )
● Style rules for the page footer area (use an id named footer ) for background
color ( #ccaa66 ), text color ( #000000 ), small font size (.60em), italics, and
Save the file as javajam.css in the javajamcss folder. Check your syntax with the
CSS validator ( http://jigsaw.w3.org/css-validator). Correct and retest if necessary.
2. The Home Page. Launch Notepad and open the index.html file. You will modify
this file to apply styles from the javajam.css external style sheet as follows:
Add a <link /> element to associate the Web page with the javajam.css exter-
nal style sheet file. Save and test your index.html page in a browser and you'll
notice that the styles configured with the body and h1 selectors are already
Configure the navigation area. Since the navigation is not semantically a
“paragraph” (a collection of sentences about a central topic), replace the <p>
element with a <div> element. Assign this <div> to the id named nav .
Configure the content area with a div assigned to an id named “content”.
Code the opening div tag on a new line after the navigation div. Code the clos-
ing div tag after the end of the paragraph that contains the address and phone
number. This content id will be styled with CSS in later chapters.