Create a plain text document named "myStyles.css"; save this document. Put a comment at the top of this CSS document with your name and email address. Define your CSS declarations according to the following instructions:
H1, H2, and H3 will all display using the "Arial" or "Helvetica" font; this may be accomplished by setting the font-family
property in the following manner:
font-family:"Arial", "Helvetica", sans-serif;
Note: font-family
is the ONLY property in CSS which uses quote marks around values! We will discuss the font-family
property in more depth in a later section.
P and B will display using the "Times New Roman" or "Times" font; this may be accomplished by setting the font-family
property in the following manner:
font-family:"Times New Roman", "Times", serif;
Note: font names ARE case-sensitive in CSS, and must match the mixed-case spellings that appear in an application's font pulldown menu.
H1 will be font-size
of 36pt
. H2 will be font-size
of 24pt
. H3 will be font-size
of 20pt
. H1 and H2 will all be text-align
of center
and color
of #660066
. H3 will be text-align
of left
and color
of #000000
. P will be font-size
of 14pt
, color
of #000000
, and text-align
of left
. B will be font-weight
of bold
.
Sample properties:
font-size:36pt; color:#660066; text-align:center; font-weight:bold;
When you have finished this exercise, you may check your CSS against this solution page.
You will not actually be able to see what this CSS does until the next exercise, when you will attach your CSS document to an HTML page.
Copyright © 2001 Michael Masumoto. All Rights Reserved.