Forum Moderators: open

Message Too Old, No Replies

problem displaying image in firefox

         

virtualspy

5:52 am on Apr 19, 2005 (gmt 0)

10+ Year Member



I am able to display an image for my website in IE but it not getting displayed in firefox.

The code for my image displaying div is as follows:

CSS:
#header
{
display:block;
background : #fff;
color : #333;
border : 0 none inherit;
margin : 0;
padding : 0;
text-align : left;
}

#header img
{
margin : 0;
padding : 0;
border : 0 none inherit;
}
in my HTML: I am accessing the image as follows:

<div id="header">
<img src="C:\Documents and Settings/XY/Desktop/website/dna_22.bmp" border="0">
</div>

What is wrong with this code?Why is the image not getting displayed in Firefox?some one help me out.

Thanks.

larryhatch

6:39 am on Apr 19, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Your image is on your C: drive. For anyone to see it online, it will have to be
uploaded to your site, and some proper link given to the file. -Larry

virtualspy

3:51 pm on Apr 19, 2005 (gmt 0)

10+ Year Member



I haven't hosted the site as yet.I am just testing the script and if everything works fine,I shall upload it to a website.But my question is the image is getting displayed in windows with the above code and not in firefox.what do you think the reason might be?

The dimensions of the image are width: 750px height: 140px.

Please help me out.

Thanks

tedster

4:08 pm on Apr 19, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Three things I see

1. Begin the link with file://localhost/
2. Replace the spaces with %20
3. No backslashes for Firefox

This should work:

<img src="file://localhost/C:/Documents%20and%20Settings/XY/Desktop/website/dna_22.bmp">

But it's much better to use a relative path than an absolute path for local viewing purposes across browsers. Assuming the html document is also in the "website" directory, just be simple --

<img src="dna_22.bmp">

I haven't hosted the site as yet.

You should probably turn that image into a compresed format (gif, png, jpg) before you put it on the server.

eljaykay

2:23 am on Apr 20, 2005 (gmt 0)

10+ Year Member



Hi -
It's always good practice to have your local setup mimic the server's - a dir for all .html or .css, .js, etc. that's called '___site', then within that dir another called 'images' where all of your images go.

Then, the linking is easy -
"images/filename.ext"

So far as this being a browser issue, I've never had Firefox balk except occassionally bkgnd. images need a <br style="clear:both;" /> before closing the final div.

You might also consider that IE accepts 'slop' and F-fox won't - validate your code to see if anything's awry.

Good luck,
El