Linking with Style
By Howard Spector
If you're like me you may have noticed that many sites are using
Cascading Style Sheets (CSS) to spice up their presentations. One drawback to CSS is that Netscape Communicator 4 and Internet Explorer 4 are not on equal terms in their support of the standard. Among the more eye-catching effects you can produce with CSS Level 2 are link-text rollovers, which are supported only in IE4. This means that when Communicator users visit a site with text rollovers, nothing happens when the user moves the mouse pointer over a link. Text rollovers are created using the CSS pseudo-class hover, which Communicator doesn't support. I'll show you how to produce these effects in IE4 and how to simulate the effects in Communicator using DHTML and JavaScript.
The Workarounds
You can get around the lack of support for the hover class by using DHTML Layers, which can be updated dynamically during mouse events. I'll show you two workarounds that will help bring Communicator closer to IE4's implementation. In the first I modify the background color by accessing the bgColor attribute of the layer object that contains the text. The other workaround can change the foreground color and even the font attributes of a link, but this option is much more complex: It uses DHTML to rewrite the HTML code contained within the layer.
Link Background Colors
The HTML program in