csshover.htc Not Working in IE 6: Server Config Issues

Written by Pat Fortino on . Posted in css, Technology, Website Design

If you use CSS dropdown menus, you probably know you need to use a hack to make the drop down work in Internet Explorer 6 (IE6). A briliant hack was created by Peter Nederlof (you can download it at http://www.xs4all.nl/~peterned). I have used it successfully for a couple years, but when I loaded a website onto a new host, the css dropdown menus didn’t work.

For the most part, the csshover.htc hack works, but it’s fussy about the file path you put into you css file; to simplify, the path need to be an absolute path; eg, from the root of your web server; do not make it relative to the css file. Below is the code you need to add to the bodytag in your main .css file

body {
behavior:url("/css/csshover.htc");
}

Once you get the correct path, you can enjoy css dropdowns in IE 6. But this setup doesn’t work on all web servers. Some server do not have a mime type set for .htc file, and, as a result, your csshover.htc file will not work. You can easily fix this if your host allows .htaccess files. Insert the following code into your .htaccess file and upload it to your server. That should fix the problem:

AddType text/x-component .htc

If you don’t have a .htaccess file, create a text file and name it .htaccess and then insert that code above.

Trackback from your site.

Find Us On…

Find WriteNowDesign on Facebook Follow WriteNowDesign on Twitter Find WriteNowDesign on Google +

Syndicate

 Subscribe in a reader

Write Now Design, LLC BBB Business Review