Web Site Case Study: Implementing CSS^117
Hands-On Practice Case
Create a folder called paintercss. Copy all the files from your painter folder into the
paintercss folder.
- The External Style Sheet. Launch Notepad. You will create an external style sheet
named painter.css. Code the CSS to configure the following:
● Global styles for the document background color (#ffffff), text color
(#000000), and Verdana, Arial, or any sans-serif font
● Style rules for the logo class that configure background color (#ffffff), text
color (#336633), and Georgia, Times New Roman, or any serif font
● Style rules for a navigation area (use an id named nav) that displays text in
bold
● Style rules for a class named category with a bold, serif font, background-color
(#ffffff), text color (#336633), and a larger font size (1.2em)
● Style rules for the page footer area (use an id named footer) with a small font
size (.60em) and italic text
Save the file as painter.css in the paintercss folder. Check your syntax with the
CSS validator (http://jigsaw.w3.org/css-validator). Correct and retest if necessary. - The Home Page.Launch Notepad and open the index.html file. You will modify
this file to apply styles from the painter.css external style sheet.
● Add a element to associate the Web page with the prime.css external
style sheet file. Save and test your index.html page in a browser and you’ll
notice that the styles configured with the bodyselector are already applied!
● Configure the logo area. Code aelement that contains theand
elements in the logo area. Assign the
to the logo class.
● Configure the navigation area. Since the navigation is not semantically a
“paragraph” (a collection of sentences about a central topic), replace the
element with aelement. Assign thisto the id named nav.
Remove the element from this area.
● Configure the- to apply the categoryclass.
- The Services Page.Launch Notepad and open the services.html file. You will
modify this file in a similar manner— add the element, configure the
logo area, configure the navigation area, configure the categoryclasses (use
elements and remove the element from this area), and config-
ure the page footer area. Save and test your new services.html page. It should
look similar to the one shown in Figure 3.27.
● Configure the page footer area. Replace theelements with
ele-
ments. Assign thisto the id named footer. Remove the and
elements because the font-sizeand font-styleare configured as part
of the footerid.
● Save the index.html file and test in a browser. Your page should look similar to
Figure 3.26.
Experiment with modifying the painter.css file. Change the page background color, the
font family, and so on. Test your pages in a browser. Notice how a change in a single
file can affect multiple files when external style sheets are used. - The Services Page.Launch Notepad and open the services.html file. You will