Welcome to WebmasterWorld Guest from 50.17.74.162

Forum Moderators: not2easy

Message Too Old, No Replies

External CSS file breaks hover menus.

     

Kerms

7:49 pm on May 20, 2008 (gmt 0)

5+ Year Member



Hello,

I am having a problem with an external css file breaking my hover menus.

In my header I have the following:

Note that this works FINE.


<link href='images/css/style.css' rel='stylesheet' type='text/css' media='all' />

<!--[if lt IE 7]>
<style type="text/css" media="screen">
body { behavior: url(images/css/csshover.htc); font-size: 100%; }
img { behavior: url(images/css/iepngfix.htc); }
</style>
<![endif]-->

</head>

when I change this to refence the css style sheet absolutely:


<link href='http://mywebsite.com/images/css/style.css' rel='stylesheet' type='text/css' media='all' />

<!--[if lt IE 7]>
<style type="text/css" media="screen">
body { behavior: url(images/css/csshover.htc); font-size: 100%; }
img { behavior: url(images/css/iepngfix.htc); }
</style>
<![endif]-->

my hover/dropdown menus stop working. Why would changing the href location of the stylesheet affect this?

garann

5:18 pm on May 21, 2008 (gmt 0)

10+ Year Member



I had a similar problem with behaviors at one point.. If you're testing this in a file stored not on your site but on your local machine or a dev server, that may be your problem. Do you have the same problem when looking at the page once it's uploaded to your server?

Kerms

10:31 pm on May 21, 2008 (gmt 0)

5+ Year Member



Thank Garann,

I tested this on my server and had problems.

Here is what my dir tree looks like:
/
/public_html/
/public_html/images/

I have mydomain.com point to /public_html/
and have images.mydomain.com point to /public_html/images/

So my css file points to:
/images/css/style.css

but when I point it to:

[images.mywebsite.com...]

it stops working.

It works fine for all other images and everything, its just that my hover menus stop working.

Does it maybe have something to do with the fact that I apply a csshover.htc behavior? I'm not quite sure what it does but it does allow my hover menus to work.

 

Featured Threads

Hot Threads This Week

Hot Threads This Month