Jump to content

IE conditional comments ?

Sea Dragon

Recommended Posts

This site looks good in Firefox but none of my images show in IE, in fact it just sits there trying to load until I finally just close it. All of my images are .png. Should I write a CSS for IE and save all images as .gifs or .jpgs to get it to render right? Then, I'm not sure on the IE CSS - do I have to incorporate the whole main css, or just write it to show the different format of images?

Here's the link -(spaces added) stephen wesley agency.com/client_preview_area/Rapid%20Environmental/ index.html (only loaded the home page)


So, something like this in the head-


where I then have just my different format of images with the same image rules as the main css? Do I have to add the css image rules? Or will it pick it up from the main?


Am I on the right track:/


Or should I do something entirely different for frickin' IE?



Edited by Sea Dragon
Link to comment
Share on other sites

Hang tight, one of the regulars has done it often. There are IE work arounds and he knows them. Just forgot who it is right off hand. IE7 supports transparent PNGs better and IE 8 should be full support I think.


Or pop over to the old forum and do a search for PNG transparencies. He had a few threads talking about it there.

Link to comment
Share on other sites

OK, looks like I will be writing an extra style sheet for IE6 and possibly IE7. I also read that I don't need to write all the styles from my main css for each IE css. I need only write the required fixes and then in the

link first to my main.css, then to the IE6.css. There is also some code for writing one that includes all versions. These style sheets will mainly deal with my bkg, header and footer .png images.

But the images that I have within my body content that are different on each page, I have changed to .jpg at this point. I'm not sure, but if I wanted to leave them as .png (maybe because of transparency or something) would I write a conditional comment directly in the html? And would it look like this?



Link to comment
Share on other sites

You can write conditional comments directly into the markup, but it isn't often done and I'm not sure if experts approve. (It's done for dropdown menus where IE6 has to have a small table inserted but other browsers don't need it.)


However, your code would apply two images in IE6; (one wouldn't work but it would leave a space) so you have to insert several conditional comments, one for IE greater than IE6, one for NOT IE (other browsers) and then one for IE6, something like this although I haven't tested it:-




Note the space between ie and 6. lte means less than or equal, gte means greater than or equal.


The not ie code can be nested inside the if gte ie code as an alternative.


See http://w ww.javascriptkit.com/howto/cc2.shtml


where the nested ........ is NOT IE. Note the different start and ending.

Edited by Wickham
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...