I have some simple html code with an <img> tag that is trying to display an image in IE8. I am using an external CSS file. for the jpg I am just using an id with width and height properties set.
I am unable to see the image when I click on the html file. If I go to IE and click File/Open, I can see it. If I remove my line of code that links to my CSS file, I can also see it.
The jpg has been created in Photoshop CS2 and CS4. I also installed Photoshop clean on another machine that also has IE8 and same thing. I tired changing color profiles in PHotoshop to no avail and nothing. Funny thing is that a jpg I created on 11/16/10 does work. Any others don’t.
I can see the file in Firefox, Opera, Chrome, etc.
Is there a bug in IE8 with CSS that I need to know about?
I am about to try IE7 and IE9 to see if same thing happens.
I am just using an id with width and height properties set.
But I can’t figure where you’re talking about. The only rules I see in your css are classes not id’s. Or is it this one: <img src=“images/test.jpg” id=“logo” alt=“logo” />
You’re right that he should close that tag properly, but that’s not the reason the image is not showing! It must be a mistake in the path ore something.
I changed the link to include the / at the end.
Also changed the path to “./images/test.jpg”
neither worked.
weird because initally i thought it was a Photoshop issue. i thought something was wrong wiht the jpeg, but EVERY jpeg I Optimize for Web has the same issue. in either CS2 or CS4. I installed CS2 on a different machine, clean install, same thing. both machines have IE8. everytime i test, I create a new file in Photoshop. I changed my color profiles and all, nothing. However, I have one file that I created on 11/16 and it works fine! I tired comparing that file to the files I’ve been creating today and all the settings are the same as far as size, colors, etc.
i’m going to send my jpg (one of the ones that don’t work)…attached.
You actually would have got a smaller file size if you had used the PNG format.
I assume you are using RGB format which it looks like you are doing. Try with the CSS disabled and clear the browser cache, temporary files and history as sometimes with M$IE that can effect things.
I’ve tested locally your images in an ad-hoc page. I had no trouble with either images.
Make a simple page, with both test and working images, nothing else. Use img tag with src attribute, and a second pair, using CSS background declaration. If you still have trouble seeing both, in both cases, I assume it’s either a security related issue or it has something to do with decoders on your system.
This, or you have some CC in your code, gone wrong.
I will try to use a background image like you are suggesting, that crossed my mind yesterday.
It’s something with my CSS or xhtml. The files that are not working, when I insert them into other xhtml files with <img> tags they work fine. something wrong with this code, that’s preventing it from displaying. just so weird…
I did clean out my temp files and history xhtmlcoder. that was what I did when i first discoverd the issue, when I originally thought it was Photoshop related, which I know now it’s definitely not.
noonnope, i will try the CSS background dec and let you know. material designer thanks for the advise!
update, background image works.
also when i validate my css code it complains that the foreground and background colors are same, but i wouldnt think that should make a difference…
believe it or not, i’m only using notepad.
this is simple and i should be able to place an <img> tag, i know i’m stubborn
I have an answer and it’s inexplicable. my original xhtml notepad file was corrupt. when I posted the code on here last night, i had created a copy. so for some reason I just went into that file thinking it was an old file I created a few weeks back and it works…wtf???
thanks guys for your help. doesn’t make sense. at least it explains why the problem followed my other machine. i was using the same file of code.