Skip to the Main Content

Note:These pages make extensive use of the latest XHTML and CSS Standards. They ought to look great in any standards-compliant modern browser. Unfortunately, they will probably look horrible in older browsers, like Netscape 4.x and IE 4.x. Moreover, many posts use MathML, which is, currently only supported in Mozilla. My best suggestion (and you will thank me when surfing an ever-increasing number of sites on the web which have been crafted to use the new standards) is to upgrade to the latest version of your browser. If that's not possible, consider moving to the Standards-compliant and open-source Mozilla browser.

January 4, 2004

:hover Craft

The brilliant Peter Nederlof has found a JScript hack to enable CSS :hover behaviour on arbitrary elements in IE/Win.

Since I’m generally in favour of crufty hacks for crufty browsers, I’ve implemented his solution here at Musings. It took a bit of rejiggering of my CSS code to avoid the use of child selectors (>), which IE still does not understand. With a bit of IE DOM manipulation,

window.onload = function(){
        if (navigator.appName == "Microsoft Internet Explorer") {
                document.body.style.behavior = 'url(\"/csshover.htc\")';
        }
};

I can even do it with a CSS stylesheet that still validates.

In plain English, that means that my sidebar now works in IE/Win, and the user-experience now more closely approximates that of a Standards-Compliant browser. Let me know if you find any problems. I don’t promise to fix them, but you never know …

[ Tip 'o the hat to Anne van Kesteren.]

Posted by distler at January 4, 2004 4:03 PM

TrackBack URL for this Entry:   http://golem.ph.utexas.edu/cgi-bin/MT-3.0/dxy-tb.fcgi/282

0 Comments & 0 Trackbacks

Post a New Comment