Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and beginning April 20th, 2021 (Eastern Time) the Yahoo Answers website will be in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.

XHTML Image won't load?

I have just started using xhtml to try to make programs. Learning everything went smoothly, until i got to the image part. I did exactly what my xhtml and all the websites i looked at said but still nothing.

Anyone know whats wrong. Have tried various codes here is an example.

<!DOCTYPE HTML PUBLIC

“-//W3C//DTD HTML 4.01 Transitional//EN”

http://www.w3.org/TR/html4/loose.dtd%3E

<html xmlns=”http://www.w3.org/1999/xhtml%E2%80%9D%3E

<head>

<title> Greatest Chess Players </title>

</head>

<body>

<img src=“fischer.jpg” />

</body>

I even changed the location and still nothing. Anyone know whats wrong?????? With location and different image i had

<img src=“C:\Documents and Settings\user\My Documents\My Pictures\004689.jpg” alt=“why isn’t this working” />

The caption works, but the image doesn't load.

Update:

Wow ridiculous, figured it out. I had all the required things on there just didn't post whole text.

The only problem was that I was using word for it. I saved the docs as plain text docs, but apparently word does not remove the formatting on the quotation marks ("), which I realized after taking the source code of a different side and putting it side by side with mine. So I changed the quotation marks and whadaya know, works like a charm.

Update 2:

I'll let you guys vote for best answer, all good, just not what the problem was.

3 Answers

Relevance
  • Tikken
    Lv 6
    1 decade ago
    Favorite Answer

    Be sure to validate your code, as you are missing the html closing tag, as well as the required alt attributes on your images. Your doctype is also written incorrectly.

    If something was coded incorrectly, then the page quite simply wont load, since you are using XHTML. You should also be sure to serve your page with the correct mime-type, that is achived by installing a web server, and setting it up to serve XHTML with the application/xhtml+xml mime type.

    http://validator.w3.org/ - Markup Validator

    Source(s): http://www.brugbart.com/Articles/148/ - XHTML vs HTML http://www.brugbart.com/Articles/149/ - XHTML and Mime Types http://www.brugbart.com/Articles/4/ - The Importance of Doctypes
  • 1 decade ago

    Well, not all image will show up in all type of browser. E.g. A CMYK image save as jpeg will show up in Firefox but not Internet Explorer.

    Therefore, if you are using IE, I say you need to change the mode of the image to RGB....(Photoshop, or maybe some other image editor)

    Good luck

  • 1 decade ago

    I'm confused, are you trying to view it offline? Try hosting the image online and then link to it

    FYI, this tag is open

    >http://www.w3.org/TR/html4/loose.dtd%3E

    You're missing the < in front

Still have questions? Get your answers by asking now.