Jump to content

Image does not work


garyblackpool

Recommended Posts

Hi, my problem is that a image which i have does not work however when i try another image it does work. Could you tell me what the probalem with it could be thanks. Here is the code i am using-its just to try to make it work, I have checked it in the validator and it says that it needs alt but i am trying to use it as a background image. Thanks.<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" dir="ltr"><head><title>Stage1</title></head><body><table><tr><td rowspan="2"><img src="rose.gif" width="200" height="500"/> </td> <td> Garden</td></tr><tr><td> links</td><td>links</td><td>links</td></table></body></html>

Link to comment
Share on other sites

Guest FirefoxRocks

Use CSS for background images: td {background-image:rose.gif}That way you don't need to specify alt. Also try to see if the image exists on the server :)

Link to comment
Share on other sites

is rose.gif in the same folder as the page? If you want to use it as a background use CSS to make it a real background<td style="background:url(rose.gif);width:200px;height:500px;"> </td>

Link to comment
Share on other sites

I have done the changes which you have suggested however I still cant get the image to work, it does work with a different gif image. The image is not on a sever its on my computer within the same file as the html. Thanks. Could it be a problem with the image itself?

Link to comment
Share on other sites

one extra thing..<img src="rose.gif" width="200" height="500"/>needs to be<img src="rose.gif" width="200" height="500" />There needs to be a space between the slash at the end and any attributes before it in xhtml. :)

Link to comment
Share on other sites

The image is not on a sever its on my computer within the same file as the html. Thanks.
by this do you mean in the same folder? check that it isalso in your computer right click the image and click 'open with' then firefox or whatever your browser is to see if the file is corupt or wont open in your browser for whatever reason. make sure the file is actually a gif if that is how your refering to it in the html
Link to comment
Share on other sites

Ok yeah i did mean folder when i said file. I checked that it worked within another browser; the html file did not work but i did try to open the gif file by going to open with: i chose netscape which did open the file as a image. And i have also checked that it was a gif by selecting the file looking in properties and it was its file size was 1.51 MB and the image which has been working in my html code is 4.29 KB. Thanks

Link to comment
Share on other sites

If the browser will display one image but not another image, there are 2 possibilities. Either the file is not an image, or the browser can't find the file. Those are the only two possibilities. If you can open the file as an image, then the problem is that the browser can't find the file.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...