By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,961 Members | 1,333 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,961 IT Pros & Developers. It's quick & easy.

CSS in IE6 help much apreciated.

P: 4
Hi all

I've just started with CSS as part of a Masters course. I have a couple of pages up and running but am encountering an issue in IE6. The pages work fine in IE 7 and firefox but for some reason in IE6 my images get dumped to the bottom. They are supposed to sit in the right hand div and slightly overlap the left had edge.

I'm sure there is something simple amiss but I'm going around in circles and would really apreciate some help before I completely mess up the code. A friend posted the question for me on metafilter, I got some replies but the suggestions didnt seem to work out..

Im not sure what the etiquet is here (code or url) so here are the urls:

Thanks if you can help

http://www-users.york.ac.uk/~ga114/
http://www-users.york.ac.uk/~ga114/cricket.html
Oct 27 '06 #1
Share this Question
Share on Google+
9 Replies


drhowarddrfine
Expert 5K+
P: 7,435
I have been preaching for years, and getting tarred and feathered, about how bad IE6 is as a browser but it is just now that people like you are seeing what I am talking about. Evidence is how the 'improved' IE7 is now displaying more like every other browser while IE6 falls apart.

But I digress.

Check the widths of your containing element compared to the total width of the contained elements. IE tends to throw in a few extra pixels to help screw you up. Even if the total width is supposed to be, say, 800px and everything adds up to 800px, IE will add a few more.
Oct 27 '06 #2

P: 4
You are right now I am seeing the evil that is IE 6 I'll check out the widths, it is odd how in various IE's 50% + 50% rarly seems to add up to 100%. Loooks great in 7 and Firefox but most university computers seem to have IE6.
Oct 27 '06 #3

drhowarddrfine
Expert 5K+
P: 7,435
Unless your school opts out, IE7 will be pushed with Windows Update in the next couple of weeks.
Oct 27 '06 #4

SamKL
P: 27
Are you thinking it's safe to say IE6 is finally going to phase out?

(I really hope so...)
Oct 27 '06 #5

drhowarddrfine
Expert 5K+
P: 7,435
Good question. How many average Joes update their computers when auto update tells them to? How many have auto update on? How many corporations didn't heed Microsofts warnings that their sites might break under IE7 and didn't fix them? So now they won't let their users upgrade. Some people still use IE5.

As sites start making themselves more standards compliant and people notice the sites don't work in IE6, enough will be told to upgrade to IE7, or switch to better browsers like Firefox or Opera, that IE6 will fade. The whole IE thing is such a mess.
Oct 27 '06 #6

P: 4
Well I tried playing around with widths.. it will work in ie6 as long as the image does not overlap the div next to it which kind of defeats the object. So do I stick with what I think looks good (and works in 7, ff, opera, etc...) or have somrthing that does not look quite as good but works in all browsers, therein lies the question I suppose.
Oct 27 '06 #7

P: 50
the solution is to have 2 stylesheets, use javascript to detect the browser then document.write the link to external sheet based on user_agent.....
I typically have a mozStyle.css and an ieStyle.css.......

It's the only solution that will keep you sane.
Oct 27 '06 #8

P: 25
Could you give an example of the code that gets you there? Is it javascript? I've seen a few multiple stylesheets but the ie.css versions I've viewed all seem to have only two divs, usually something to do with container and body. I'm just baffled by how that actually works.

I'm battling FF vs. IE (sort of like Godzilla vs. Hedora) and think this may be my simplest solution.

Thanks!

Kathy
Oct 31 '06 #9

P: 50
Expand|Select|Wrap|Line Numbers
  1. <SCRIPT LANGUAGE = "JavaScript">
  2. <!-- 
  3. var browser     = '';
  4. var version     = '';
  5. var entrance    = '';
  6. var cond        = '';
  7. // BROWSER?
  8. if (browser == ''){
  9. if (navigator.appName.indexOf('Microsoft') != -1)
  10. browser = 'IE'
  11. else if (navigator.appName.indexOf('Netscape') != -1)
  12. browser = 'Netscape'
  13. else browser = 'IE';
  14. }
  15. if (version == ''){
  16. version= navigator.appVersion;
  17. paren = version.indexOf('(');
  18. whole_version = navigator.appVersion.substring(0,paren-1);
  19. version         = parseInt(whole_version);
  20. }
  21. if (browser == 'IE' && version >= 4) document.write('<'+'link rel="stylesheet" href="iestyle.css" />');
  22. if (browser == 'Netscape' && version >= 2.02) document.write('<'+'link rel="stylesheet" href="mozillastyle.css" />');
  23. // -->
  24. </SCRIPT>
Nov 1 '06 #10

Post your reply

Sign in to post your reply or Sign up for a free account.