homepage Welcome to WebmasterWorld Guest from 54.211.235.255
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / CSS
Forum Library, Charter, Moderators: not2easy

CSS Forum

    
External CSS file breaks hover menus.
Kerms




msg:3654755
 7:49 pm on May 20, 2008 (gmt 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?

 

garann




msg:3655519
 5:18 pm on May 21, 2008 (gmt 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?

Kerms




msg:3655849
 10:31 pm on May 21, 2008 (gmt 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.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / CSS
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved