...

View Full Version : Background image with space in the file name problem



mversion
11-17-2009, 01:00 AM
Basically, I am trying to get logos to come up for various suppliers. The brand names are pulled from the backhand, and I have to use a custom token.

eg.
<div style="background: url([CSS:ProductBrandName:].gif) no-repeat; position: relative; width: 170px; float: right; height: 50px"></div>

So [CSS:ProductBrandName:].gif gets replaced by, say, Cambridge Audio.gif.

However, as a background image this does not work in firefox. In internet explorer it does.
If I use <img src="[CSS:ProductBrandName:].gif" /> it works. But not as a background image, and not in Firefox.

Any idea? I need to have it as a background image so users don't get a no image icon if there's no actual logo file.

Thanks.

mversion
11-17-2009, 01:54 AM
Ah! Stupid me, it was the lack of an apostrophe enclosing the url. All fixed now. Just in case anyone else has a problem I'll leave this threat posted.

Bad:

background: url(files/web_logos/[CSS:ProductBrandName:].gif)
Good:

background: url('files/web_logos/[CSS:ProductBrandName:].gif')

oesxyl
11-17-2009, 01:56 AM
Basically, I am trying to get logos to come up for various suppliers. The brand names are pulled from the backhand, and I have to use a custom token.

eg.
<div style="background: url([CSS:ProductBrandName:].gif) no-repeat; position: relative; width: 170px; float: right; height: 50px"></div>

So [CSS:ProductBrandName:].gif gets replaced by, say, Cambridge Audio.gif.

However, as a background image this does not work in firefox. In internet explorer it does.
If I use <img src="[CSS:ProductBrandName:].gif" /> it works. But not as a background image, and not in Firefox.

Any idea? I need to have it as a background image so users don't get a no image icon if there's no actual logo file.

Thanks.
it's obvious, the solution is to change the names to make them normal. Each os have it's conventions for filenames, you can't ignore this.

I miss the missing quote, :) This fix the problem for css but will get other problems later with other things. The best solution finaly is to change names
best regards.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum