Home > Articles > Web Development > HTML/CSS

  • Print
  • + Share This
This chapter is from the book

Workshop

The Workshop contains quiz questions and exercises to help you solidify your understanding of the material covered. Try to answer all questions before looking at the “Answers” section that follows.

Quiz

  1. What code would you use to create a stylesheet to specify 30-point blue Arial headings and all other text in 10-point blue Times Roman (or the default browser font)?
  2. If you saved the stylesheet you made for Question 1 as corporate.css, how do you apply it to a web page named intro.html?
  3. How many different ways are there to ensure that style rules can be applied to your content?

Answers

  1. Your stylesheet would include the following:

    h1 { font: 30pt blue Arial; }
    body { font: 10pt blue "Times New Roman"; }
  2. Put the following tag between the <head> and </head> tags of the intro.html document:

    <link rel="stylesheet" type="text/css" href="corporate.css" />
  3. Three: externally, internally, and inline.

Exercises

  • Using the stylesheet you created earlier in this hour, add some style classes to your stylesheet. To see the fruits of your labor, apply those classes to the HTML page you created as well. Use classes with your <h1> and <p> tags to get the feel for things.
  • Develop a standard stylesheet for your website, and link it into all your pages. (Use internal stylesheets and/or inline styles for pages that need to deviate from it.) If you work for a corporation, chances are, it has already developed font and style specifications for printed materials. Get a copy of those specifications, and follow them for company web pages, too.
  • Be sure to explore the official stylesheet specs at http://www.w3.org/Style/CSS/, and try some of the more esoteric style properties not covered in this hour.
  • + Share This
  • 🔖 Save To Your Account