/    Sign up×
Community /Pin to ProfileBookmark

image display issue

Hello,

I was wondering why this is not displaying my image on a macintosh. Here is the code:

[CODE]<!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.01 STRICT//EN” “http://www.w3.org/TR/HTML401/strict.dtd”>
<html dir=”ltr” lang=”en”>
<head>
<meta http-equiv=”Content-Type” content=”text/html; charset=utf-8″>
<meta http-equiv=”Content-Script-Type” content=”text/javascript”>
<title>Image Viewer</title>
</head>
<body>
<p>
<img src=”images/7.png” alt=”7.png”>
</body>[/CODE]

Thank you for any help!

to post a comment
HTML

8 Comments(s)

Copy linkTweet thisAlerts:
@tabzterSep 28.2005 — Theres no ending </html> tag and seeing that your using a STRICT doctype any errors that occur will not be tolerated by the browser
Copy linkTweet thisAlerts:
@continuoauthorSep 28.2005 — ooops, sorry, that was a copy and paste error

It should be:

[CODE]<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 STRICT//EN" "http://www.w3.org/TR/HTML401/strict.dtd">
<html dir="ltr" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="Content-Script-Type" content="text/javascript">
<title>Image Viewer</title>
</head>
<body>
<p>
<img src="images/7.png" alt="7.png">
</body>
</html>[/CODE]
Copy linkTweet thisAlerts:
@tabzterSep 28.2005 — try these 2 things:

i) end your </p> tag after the image. if that works....no need to carry on.

ii) change <!DOCTYPE> to transistional.
Copy linkTweet thisAlerts:
@UltimaterSep 28.2005 — tabzter, there is nothing wrong with the STRICT DOCTYPE in this situation and the P tag isn't required to have a matching </p> tag. It's valid HTML. Try validating it through the valdiator.
Copy linkTweet thisAlerts:
@fredmvSep 28.2005 — For one, the DOCTYPE is incorrect. Use instead:
&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd"&gt;
And let us know how that works out for you.
Copy linkTweet thisAlerts:
@tabzterSep 28.2005 — Im not sure how strict mac is with browser DOCTYPE definitions as I dont have one. So to be on the safe side I presumed that the above coding should be perfect for it to work as I cant see where the coding is wrong.
Copy linkTweet thisAlerts:
@UltimaterSep 28.2005 — Let me bring to this thread's attention that I am the one who told continuo to make this thread.


https://webdeveloper.com/forum/showthread.php?t=80389 (JavaScript forum)

There was a problem with the Image URL not pulling-up the image at all -- which he is also on a macintosh, so I'm not confident that the URL is correct. The JavaScript code works fine for doing what he wanted in JavaScript to generate a dynamic path. The only thing is that he is on a mac and I'm on a pc and we narrowed the issue down to some plain-and-simple HTML using a simple IMG tag. His actual tangible Image and HTML file are located in the very same directory folder on his macintosh. (just the images are in a subdirectory called "images") He is running the HTML file locally and his Images are not being found. We are trying to assign the IMG tag's SRC attribute with the correct URL to the images and one of the images in that directory is called "7.png"

I have already suggested to him all of the following three -- I can't actually verifiy if he tried them though:
<i>
</i>&lt;img src="images/7.png" alt="7.png"&gt;
&lt;img src="/images/7.png" alt="7.png"&gt;
&lt;img src=".images/7.png" alt="7.png"&gt;


Using the pharse mode that fredmv suggested, continuo, give this a run in the same directory as your HTML file, call it "blah.htm" or something:
<i>
</i>&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd"&gt;
&lt;html dir="ltr" lang="en"&gt;
&lt;head&gt;
&lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8"&gt;
&lt;meta http-equiv="Content-Script-Type" content="text/javascript"&gt;
&lt;title&gt;Image Viewer&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;p&gt;
&lt;img src="images/7.png" alt="7.png"&gt;
&lt;/body&gt;
&lt;/html&gt;

Then re-try all of the three possibilities for the IMG SRC.

I hope someone that is good with macs comes in here to solve this issue so I can also learn from it for the future.
Copy linkTweet thisAlerts:
@continuoauthorSep 29.2005 — by removing the forward slashes from the location in the script, my browser can locate the image files.

the image tags after the script were perfectly fine.

Thank you guys for all of your help.

Since this is a project of mine which I am making no money from, I will give credit to those who have helped.
×

Success!

Help @continuo spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.2,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,
)...