views:

71

answers:

2
+1  Q: 

Float Issue in IE

Ok I am making a simulated OS type interface. It should open up windows and have a drag handle. This all works perfectly. Then I added a image for an exit button I floated to the right... this made IE mad and IE screwed with the sizing and positioning =[

I've tried a crap load of things. None of which work. Anyone wana help?

website is

http://opentech.durhamcollege.ca/~intn2201/brittains/labs/

Thanks Shelby

+1  A: 

It's an issue with IE 6 & 7:
http://blogs.msdn.com/askie/archive/2009/03/23/right-floated-element-in-internet-explorer-8-is-positioned-differently-than-internet-explorer-7.aspx

The only solution I can come up with is something like:

<!--[if lte IE 7]>
    <style type = "text/css">
        #windowExitImage{margin-top:-27px}
    </style>
<![endif]-->

Because it's technically a comment, only IE 7 on back will pay attention to that. So IE 8 and other browsers will display it the way they already do, which does in fact look right.
http://css-tricks.com/how-to-create-an-ie-only-stylesheet/

Matt Blaine
oddly enough first time i loaded it that idea did not work. But now its working oddly 0.0
MrEnder
thanks a lot for the help ^.^
MrEnder
@MrEnder, if this answered your question please accept the answer (click on the tick-mark outline below the number on the left).
David Thomas
ok i did sorry new to SO
MrEnder
Oh, nothing to be sorry for. At any rate, thanks.
Matt Blaine
+1  A: 

Another solution would be to not use floats at all.

#dragHandle { 
  position: relative; 
}

#windowExitImage {
  position: absolute;
  top: 4px;
  right: 0px;
}

This will work better cross-browser and remove the need for an IE6/7 specific CSS rule.

jrallison
Ya but that wont size properly on all resolutions =[
MrEnder