< Back
Page 9 of 9
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
- 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)?
- 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?
- How many different ways are there to ensure that style rules can be applied to your content?
Answers
Your stylesheet would include the following:
h1 { font: 30pt blue Arial; }
body { font: 10pt blue "Times New Roman"; }
Put the following tag between the <head> and </head> tags of the intro.html document:
<link
rel
="stylesheet"
type
="text/css"
href
="corporate.css"
/>
- 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.
< Back
Page 9 of 9