Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with image path in Firefox 1

Status
Not open for further replies.

theniteowl

Programmer
May 24, 2005
1,975
US
Hi All,
I have a problem with a site I created for a local school.
This line:
Code:
<td width="770" height="6" background="../images/contenttop.gif" colspan="3"></td>
works in IE but not in Firefox.

Before this page loads I issue this command from PHP:
Code:
echo '<base href = "'.$mydomain.$folderpath.'/'.'">';
I do this because the template for the page loads from the root and then it does an include to insert the content section into the proper area of the page. The base tag sets the base href to the folder the content page resides in so all paths would work relative to that folder.
This works fine in IE and in Firefox the paths all work correctly for loading the pages but not for loading the images that are in the images folder off the root.

Any thoughts on why this would happen? Is ../ not compatible with Firefox in some way or just regarding images rather than hrefs?


At my age I still learn something new every day, but I forget two others.
 
Background is not a supported attribute in html. It's implementation usually works, but there is no guarantee when using attributes that are not part of the standard. Maybe FF is simply ignoring it. I suggest you control all that via stylesheet for better cross-browser compatibility.
 
Ooh, stylesheet. That might work a lot better than my other options. I will give it a try.
Thanks.

At my age I still learn something new every day, but I forget two others.
 
That did the trick Vragabond.
IE supports the background property but not Firefox but moving it into the stylesheet fixed the problem.



At my age I still learn something new every day, but I forget two others.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top