IE CSS, where to put the .htc file???

0 views
Skip to first unread message

sayoyo

unread,
Mar 8, 2007, 2:15:58 PM3/8/07
to rubyonra...@googlegroups.com
HI,

I try to create a very simple menu with CSS in IE (and I always use
firefox) but I have to make the web application compatible with IE :(
...
I realize the :hover is not working on <ul> and <li> in IE, I have to
put a line in the body in css

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

and I have not idea where should I put this file, (the file contains JS
that allow the :hover on any element in html... the file is form Eric
meyer.

does some one know where and how should I put the file???

Thanks you very much

Sayoyo

--
Posted via http://www.ruby-forum.com/.

Scott Becker

unread,
Mar 8, 2007, 2:22:05 PM3/8/07
to rubyonra...@googlegroups.com
Put it in the same folder as your css file. The syntax url(csshover.htc) will look for the file in the same folder as itself.

Thanks,
--
Scott Becker
Electro Interactive, Inc.
Office: 813-333-5508
http://www.ElectroInteractive.com
--
Scott Becker
Electro Interactive, Inc.
Office: 813-333-5508
http://www.ElectroInteractive.com

sayoyo

unread,
Mar 8, 2007, 2:49:28 PM3/8/07
to rubyonra...@googlegroups.com
Hi, Scott

I have already try to put it in the public/stylesheets/, but it doesn't
work...

any idea?

thanks you very much!!!!

Scott Becker

unread,
Mar 8, 2007, 2:59:41 PM3/8/07
to rubyonra...@googlegroups.com
Sayoyo,

Change it to read:

behavior: url(/stylesheets/csshover.htc);

Also, inside csshover.htc, it might refer to a 'blank.gif' somewhere. If so, make sure this file exists in your public/images directory and change the url within csshover.htc to '/images/blank.gif'

Mine is called iepngfix.htc and it has this as line 14:
if (typeof blankImg == 'undefined') var blankImg = '/images/blank.gif';

Thanks,
--
Scott Becker
Electro Interactive, Inc.
Office: 813-333-5508
http://www.ElectroInteractive.com

On 3/8/07, sayoyo <rails-mai...@andreas-s.net> wrote:

sayoyo

unread,
Mar 8, 2007, 3:37:50 PM3/8/07
to rubyonra...@googlegroups.com
Hi, Scott,

by adding "/stylesheet/", now the css is able to find the .htc, Thanks
you very much!!!! and another thing I have changed is the .htc file
given by Eric Meyer, he used :media => 'screen', and I was using :media
=>'all', it has created a problem too, now I have changed my code, my
menu is shown correctly now,

Thanks you very much for your help!!!!!

Seth Thomas Rasmussen

unread,
Mar 8, 2007, 6:46:17 PM3/8/07
to Ruby on Rails: Talk
It might be worth pointing out that it was failing because of Routes,
not CSS. The CSS was behaving exactly as it should on both counts.
Basically, you have routes to your assets setup for you behind the
scenes. At least, I would put money on this guess.. check your logs
with out the absolute path and see if there are routing errors.

In other news, you might like to know that you can do CSS menus with
*standard* JS fallbacks for IE. Suckerfish has been around for a good
few years or more. There are surely other alternatives.

I think I used an .htc file once like four years ago..

Scott Becker

unread,
Mar 11, 2007, 6:00:58 PM3/11/07
to rubyonra...@googlegroups.com


On 3/8/07, Seth Thomas Rasmussen <sethra...@gmail.com> wrote:

In other news, you might like to know that you can do CSS menus with
*standard* JS fallbacks for IE. Suckerfish has been around for a good
few years or more. There are surely other alternatives.


I believe Sayoyo is using the .htc for fixing PNG alpha transparency in IE6, not for CSS menus. There are other alternatives with pure JS to do the fix, but you have to re-run it again any time a new transparent PNG is inserted into the page. This is the easiest, most unobtrusive approach I've found - a css one-liner ( behavior: url( iepngfix.htc) ) that gets applied to any element that applies to the css selector.  No special JS to run in the onload event of your pages, or when a new image is created or inserted in the DOM, as long as a css style is defined for it - it just works.
Reply all
Reply to author
Forward
0 new messages