469,356 Members | 2,196 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,356 developers. It's quick & easy.

CSS in IE6 help much apreciated.

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
9 1390
drhowarddrfine
7,435 Expert 4TB
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
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
7,435 Expert 4TB
Unless your school opts out, IE7 will be pushed with Windows Update in the next couple of weeks.
Oct 27 '06 #4
SamKL
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
7,435 Expert 4TB
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
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
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
skase98
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
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.

Similar topics

12 posts views Thread by windandwaves | last post: by
8 posts views Thread by Steve1 via DotNetMonster.com | last post: by
4 posts views Thread by bipi | last post: by
reply views Thread by Pretty nice site, wants to see much more on it!,Pr | last post: by
7 posts views Thread by Sanny | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
1 post views Thread by Marylou17 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.