This month you learn to implement two essential Cascading Style Sheet elements in your HTML documents: Active and Hover elements. These two elements compliment each other and can be implemented in your project in a matter of minutes.
What is a style sheet? A style sheet is a document that defines a set of rules. The rules define how certain elements on an HTML page will appear. Most of you are familiar with template styles such as Heading 1, Normal, Body Text, etc. These same formatting elements are used in HTML Cascading Style Sheets and can be controlled by setting up specific "rules".
A typical rule may look something like:
H3 {font-family: Arial;
font-style: italic;
color: blue }
The rule begins with a selector H3 which is an HTML element.
The rule contains declarations inside the {} curly braces.
A declaration is a property followed by a value: font-style: italic. The two elements are separated with a colon.
If more than one declaration is made then each element must be separated with a semi-colon.
An element can also have a Class:
H3.blueitalic, which means the H3 element has a sub-style called blueitalic.
Pseudo-Classes are another element which we will be using in this month's tip:
The :link, :visited,
:active, and :hover
elements are separated from the Anchor <A> tag with a colon. For
those unfamiliar with an Anchor, the <A> tag always precedes a hyperlink.
For example:
<A HREF="http://www.magrino.com">Click Here</A>. Click Here appears as a hyperlink, the
destination is the HREF address.
When you define a Pseudo-class it effects the element cooresponding to the type of action indicated. For example: A:hover {color:red; font-style: bold;} causes the hyperlink to become red and bold when the mouse "hovers" over the link.
There's much, much more to cascading style sheets than what I've described. If you're interested in learning more I encourage you to go to the World Wide Web Consortium web site at: http://www.w3.org/Style/CSS/. This site should satisfy most questions regarding CSS.
Next, Implementing Active Elements