Friday, October 5, 2007

We started cascading style sheets (yay). They are covered in Chapter 8 of HFHTML.

Here is the style element we put into a Web page today. Recall that a selector designates the element type that the rule applies to and that the order rules are listed matters when two rules seem to contradict (as in the two color property settings for <h1> elements in the example.

<style type="text/css">
/*  style rule syntax: 

    selector {  property: value; ... }

*/

p {
    color: teal;
}

h1, h2, h3, h4, h5, h6 {
    color: teal;
}

h1 {
    border: thin black dashed;
    background-color: silver;
    color: black;
}

</style>

Homework

Read pages 285–310 of HFHTML. Add some style to your class home page on cs.wofford.int: sans-serif font of a color you choose (not black) and a background color of your choice (not white). See if you can figure out how to get a border around the whole body that is the same color as the text.

No comments: