11 replies [Last post]
Bertje
Bertje's picture
Offline
Enthusiast
Last seen: 14 years 31 weeks ago
Timezone: GMT+2
Joined: 2004-07-02
Posts: 153
Points: 0

Hi all,

When you point to images (for i.e. a background) in your CSS the path should be relative to the CSS file right?

I have a problem that the path works in IE but not in FF. isn't that weird!

Bertje
Bertje's picture
Offline
Enthusiast
Last seen: 14 years 31 weeks ago
Timezone: GMT+2
Joined: 2004-07-02
Posts: 153
Points: 0

AAaaaahhhhhhhh Help! image path problem!

more clear:

Check the menu on this page:
http://www.fabriekopzijnfrans.nl/vrstpn

The overstate for "informatie" doesn't work in IE but does work in FF. And the other ones vice versa.

All the normal states work fine. Same css, same path.

AHHHHHHHHH I'm going crazy!

css: http://www.fabriekopzijnfrans.nl/vrstpn/styles/main.css

Thanks

Bertje
Bertje's picture
Offline
Enthusiast
Last seen: 14 years 31 weeks ago
Timezone: GMT+2
Joined: 2004-07-02
Posts: 153
Points: 0

AAaaaahhhhhhhh Help! image path problem!

And in a seperate file it works just fine!!!!!!!!

http://www.fabriekopzijnfrans.nl/vrstpn/menu.html

Lorraine
Lorraine's picture
Offline
Elder
UK
Last seen: 16 years 7 weeks ago
UK
Timezone: GMT+1
Joined: 2005-01-04
Posts: 1001
Points: 0

AAaaaahhhhhhhh Help! image path problem!

html, body {height:100%; behavior:url(csshover.htc);} This line in your CSS does not validate - it could be something to do with it, perhaps Wink

EDIT: the html bit does not appear in the file that works. Difficult to keep up with the information feeds here.

Bertje
Bertje's picture
Offline
Enthusiast
Last seen: 14 years 31 weeks ago
Timezone: GMT+2
Joined: 2004-07-02
Posts: 153
Points: 0

AAaaaahhhhhhhh Help! image path problem!

But both http://www.fabriekopzijnfrans.nl/vrstpn/menu.html and http://www.fabriekopzijnfrans.nl/vrstpn/ have the behaviour.

One works, other doesn't. Why!?

Lorraine
Lorraine's picture
Offline
Elder
UK
Last seen: 16 years 7 weeks ago
UK
Timezone: GMT+1
Joined: 2005-01-04
Posts: 1001
Points: 0

AAaaaahhhhhhhh Help! image path problem!

See my previous post.

Bertje
Bertje's picture
Offline
Enthusiast
Last seen: 14 years 31 weeks ago
Timezone: GMT+2
Joined: 2004-07-02
Posts: 153
Points: 0

AAaaaahhhhhhhh Help! image path problem!

Which html bit???

both have this line in de CSS html, body {height:100%; behavior:url(csshover.htc);}

Lorraine
Lorraine's picture
Offline
Elder
UK
Last seen: 16 years 7 weeks ago
UK
Timezone: GMT+1
Joined: 2005-01-04
Posts: 1001
Points: 0

AAaaaahhhhhhhh Help! image path problem!

The page that "works" has embedded styles in which I see:
body {background:#EEE; behavior:url(csshover.htc)
and
<html>
this is the html bit that does not have "behaviour".

The page that does "not" work is referencing the external stylesheet that I quoted code from above.

Hugo
Hugo's picture
Offline
Moderator
London
Last seen: 7 years 39 weeks ago
London
Joined: 2004-06-06
Posts: 15668
Points: 2806

AAaaaahhhhhhhh Help! image path problem!

Bertje the first link in the last post would work wouldn't it.

Firstly: where is the csshover.htc file located ?

Secondly: have a think about the paths that are being variously used in the different and myriad examples you are showing us.

A hint: what's the difference between a relative path in an embedded set of styles and a relative path from an external stylesheet.

You answer your own question in the very first post Smile

Hugo.

Before you make your first post it is vital that you READ THE POSTING GUIDELINES!
----------------------------------------------------------------
Please post ALL your code - both CSS & HTML - in [code] tags
Please validate and ensure you have included a full Doctype before posting.
Why validate? Read Me

Bertje
Bertje's picture
Offline
Enthusiast
Last seen: 14 years 31 weeks ago
Timezone: GMT+2
Joined: 2004-07-02
Posts: 153
Points: 0

AAaaaahhhhhhhh Help! image path problem!

@ Lorraine, in the file that does not work, the behaviour is in the style sheet. So it is there.

@ Hugo, I know about the relative path, and I know there is a difference when the css file is located elsewhere. So I have (and already had) made adjustments for that (in the file where the style is in the html file the path to the images is "images/..." In the file with the external css file the path is "../images/..,").

But it is able to find all the images (take i.e. the arrow for the link elsewhere on the page, they show in IE and FF) except for the hover state ones in IE.

Should the path also be relative to the behaviour file? This file is for the hover to work in IE as you might have guessed.

But when I put the behaviour file next to the css file it still does not work. Any suggestions?

Bertje
Bertje's picture
Offline
Enthusiast
Last seen: 14 years 31 weeks ago
Timezone: GMT+2
Joined: 2004-07-02
Posts: 153
Points: 0

AAaaaahhhhhhhh Help! image path problem!

There seems to be a difference in the interpretation of this behaviour. It is the one recommended by Eric Meyer in his book More Em on CSS.

It is to get the hover thing to work in IE (in FF and according to W3C standards you can assign a :hover state to every element, IE thinks you only need a :hover state for the <a> element).

The thing is, it already works in FF so it uses the regular css rules and goes looking for the images via the relative path and finds them.

Somehow IE uses the behaviour and goes looking for the images from the file that uses the behaviour.

That is what it looks like. Can anyone confirm this? Is this a know problem? Thanks all (lorraine & Hugo) for helping me this far.

Anyone any sugestions?

DeprecatedDiva
DeprecatedDiva's picture
Offline
Enthusiast
NW Louisiana
Last seen: 15 years 42 weeks ago
NW Louisiana
Timezone: GMT-6
Joined: 2005-06-12
Posts: 135
Points: 0

AAaaaahhhhhhhh Help! image path problem!

Bertje wrote:
The overstate for "informatie" doesn't work in IE but does work in FF.
It doesn't work in either browser for me...

DeprecatedDiva