July 26, 1998
Putting It All TogetherOkay, let's see if we can put this all together and come up with a decent style sheet. Two new elements
|
Example headerA paragraph without the P element loses its style. In some browsers it will lose all style, not just the style specified in the P rule but also that specified in the BODY rule.
|
Example HeaderA paragraph preceeded by the P element retains its style. |
Alright, I've gone on long enough. Here's the style sheet I used to create this page.
<STYLE TYPE="text/css">
<!--
BODY { color : Maroon;
background : Wheat;
}
H1, H2, H3 { font-family : Arial, Helvetica, sans-serif;
color : black;
background : LightSlateGray;
text-align : center;
}
P { font-family : Arial, Helvetica, sans-serif;
font-size : small;
color : Maroon;
}
B { text-transform: uppercase;
font-weight : bold;
background : WhiteSmoke;
}
EM { font-style : none;
font-weight : bold;
color : red;
background : WhiteSmoke
}
UL { font-family : cursive;
font-size : small;
}
DL { font-family : serif;
font-size : small;
}
DT { font-family : serif;
font-size : small;
}
.attn {color : red;
background : WhiteSmoke;
font-weight : bold;
font-size : larger;
}
.notes {background : transparent;
font-family : Arial, Verdana, sans-serif;
font-size : xx-small;
text-decoration : none;
}
PRE {font-family : monospace;
color : black;
background : transparent;
}
A:link { color : MediumBlue }
A:visited { color : Purple }
A:hover { color : red }
A:active { color : red }
-->
</STYLE>
|
View this page without style.
Notes:
1.
W3C: 7.5.4 Grouping elements: the DIV and SPAN elements
|
|---|
|