5 replies [Last post]
jule
Offline
newbie
germany
Last seen: 15 years 1 week ago
germany
Joined: 2004-12-03
Posts: 4
Points: 0

hi all,
i really really need your help. i got a weird problem with css and ie6 at a page i'm doing for my diploma.
you can visit the page http://stud.fh-wedel.de/~mi4254/dipl.
everything works fine with mozilla, firefox, opera, konqueror and safari. but with ie6 i'm getting a weird problem.
on the right i have an absolute positioned element with the pic and the elements "Hilfsmittel für Barrierefreiheit" and "Weitere Links". it ends here, the rest of the grey column is the background-color of another element.
in ie6 it seems as if this absolute positioned element is moved 1px to the left and overlaps the darkblue border (the border is from the content-element). when you resize the window slowly you'll see that the absolute positioned element is moving 1px to the left and right in turn.
i googled the whole day and found noone with the same problem. i'd be so happy if i got this problem solved....!!
thanks for your help!!
jule

gary.turner
gary.turner's picture
Offline
Moderator
Dallas
Last seen: 17 hours 23 min ago
Dallas
Timezone: GMT-6
Joined: 2004-06-25
Posts: 9745
Points: 3824

1px problem with ie6 and absolute position

Validate your html. There are errors. Your doctype should include the url. It is required for xhtml, and not having it will likely throw IE into quirks mode. You do not want to be there.

I believe there is no good reason to write new documents to anything other than a strict DTD. If you refactor an old document, it may not be worthwhile to bring everything up to standards, but it is silly to write new code with deprecated elements. That's my story, and I'm sticking to it. Smile

I didn't spot a possible culprit, but I wonder why .right {right: 15px; margin: -15px;}. Setting {right: 0;} made no change in Firefox. I didn't test IE. Unless you have compelling reason, that's an opportunity for error.

cheers,

gary

If your web page is as clever as you can make it, it's probably too clever for you to debug or maintain.

jule
Offline
newbie
germany
Last seen: 15 years 1 week ago
germany
Joined: 2004-12-03
Posts: 4
Points: 0

1px problem with ie6 and absolute position

hi gary,
thanks much for your quick answer.
i didn't use an url in the doctype because ie6 switches to the strict-modus with an url in the doctype (i read this in a css-book). but it doesn't work with an url anyway. i also tried to use strict xhtml - no changes. it also jumps 1px to the left an right when using html instead of xhtml.
i tried this right:15px; margin-right: -15px; stuff for a problem with ie5 for mac, but it's the same with right:0 in every browser..
what did you mean with no valid html? anything else than the doctype?
i'm cracking up with this problem...
greets..
jule

gary.turner
gary.turner's picture
Offline
Moderator
Dallas
Last seen: 17 hours 23 min ago
Dallas
Timezone: GMT-6
Joined: 2004-06-25
Posts: 9745
Points: 3824

1px problem with ie6 and absolute position

You do not want quirks mode. In quirks, the browsers follow who knows what rules. Standards mode may make things seem worse, especially in IE, but at least you'll know the fault more likely lies with your code than with the browser.

You should validate your html and css. Ridding yourself of errors will often cure what ails you. If it doesn't, having clean code means that you have a starting point and ensures that some error is not causing the page to look upgefucht.

One other thing, do;

 
html, body { 
    margin: 0; 
    padding: 0; 
    }
Just another zeroing which sets a common starting point for all browsers. Different browsers use margins or padding on html or body.

cheers,

gary

If your web page is as clever as you can make it, it's probably too clever for you to debug or maintain.

jule
Offline
newbie
germany
Last seen: 15 years 1 week ago
germany
Joined: 2004-12-03
Posts: 4
Points: 0

1px problem with ie6 and absolute position

hi gary,
thanks for that tip, that spared me one wrapper element i used to fix the margin in opera.
my html code is now valid (thanks for that link, too), but the 1px error still happens ..
isn't there anyone who is familiar with this problem...? Crying
cheers,
jule

jule
Offline
newbie
germany
Last seen: 15 years 1 week ago
germany
Joined: 2004-12-03
Posts: 4
Points: 0

problem SOLVED, jeah

hi all,
i'm so glad to tell you that the problem is solved finally Laughing out loud .
for everyone who maybe will have the same problem: the solution could be found at another forum (http://www.sitepoint.com/forums/showthread.php?t=216987) where i posted the problem also.
thanks for your help anyway, gary!
jule