Welcome to WebmasterWorld Guest from 54.161.178.52

Forum Moderators: not2easy

Message Too Old, No Replies

External CSS file breaks hover menus.

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

New User

5+ Year Member

joined:May 11, 2008
posts: 12
votes: 0


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?

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

Preferred Member

10+ Year Member

joined:Sept 4, 2002
posts:508
votes: 0


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?
10:31 pm on May 21, 2008 (gmt 0)

New User

5+ Year Member

joined:May 11, 2008
posts: 12
votes: 0


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.

 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members