...

View Full Version : negative margin float trick not working IE



ReadMe.txt
08-11-2004, 01:21 PM
http://www.readmetoo.co.uk/?stylesheet=Orange

In mozilla and opera this works a treat, but in IE i get that extra 10.5em margin on the left. I know that the negative margin float trick works in IE, because I've used it before but i cant seem to figure out why this wont work.

Any clues guys?

mindlessLemming
08-12-2004, 01:12 AM
Here's your problem:


margin: -1px -10.1em 0 0;
width: 10em;

The negative margin must be less than the width of the floated element, or IE has a tantrum.
Also, if it still bugs out when you've done that, add position:relative; to all the elements involved. That's like the secret weapon when dealing with IE :)

jkd
08-12-2004, 03:09 AM
Here's your problem:


margin: -1px -10.1em 0 0;
width: 10em;

The negative margin must be less than the width of the floated element, or IE has a tantrum.
Also, if it still bugs out when you've done that, add position:relative; to all the elements involved. That's like the secret weapon when dealing with IE :)

Or zoom: 1.0; if you cannot alter the positioning property. :)

bradyj
08-12-2004, 03:11 AM
Or zoom: 1.0; if you cannot alter the positioning property. :)

I've never heard of zoom in CSS, can you explain :confused: :)

mindlessLemming
08-12-2004, 03:54 AM
"To be successful in IT you don't need to know everything - just where to find it in under 30 seconds"
;)
zoom= IE proprietry evil.
http://msdn.microsoft.com/workshop/author/dhtml/reference/properties/zoom.asp

Only works in IE >= 5.5
Known to knock off bullets from <ul>s.
http://www.webmasterworld.com/forum83/4179.htm

jkd: Can you tell us how it makes IE behave (in what situations)?
Or is one of those magic bullets, like position:relative; :rolleyes:

jkd
08-12-2004, 06:45 AM
This (http://msdn.microsoft.com/workshop/author/dhtml/reference/properties/haslayout.asp) is why. A lot of IE CSS bugs happen to come about simply because an element doesn't "have layout" (whatever the heck that means). So a * { zoom: 1.0; } at the top of your stylesheet can be a helpful thing, if you're dealing with a complicated float layout.

mindlessLemming
08-13-2004, 03:20 PM
Woohoo!
That just solved a crazy bug I was having on my site :D
:thumbsup:

ReadMe.txt
08-14-2004, 01:24 AM
surely it wont validate then though?

if the width has to be bigger than the negative margin, whats the point? wont it just cause an overlap (goes to try it)


aww damn, you guys seemed so sure it'd work - still no juice with 10em and -9.9em margin

jkd
08-14-2004, 01:37 AM
surely it wont validate then though?


<!--[if IE]>
<style type="text/css">* { zoom: 1.0; }</style>
<![endif]-->


Better?

bradyj
08-14-2004, 01:45 AM
Forgive me here, but I still don't zoom fully. Why do you need to declare it as a 'layout' for this to work in IE? I understand the purpose that it is an IE bug, so to speak -- but what does it actually do? Is it just telling this browser "This is now an active layout"... it confuses me slightly :confused:

ReadMe.txt
08-14-2004, 02:04 AM
<!--[if IE]>
<style type="text/css">* { zoom: 1.0; }</style>
<![endif]-->


Better?

guess so, last time i suggested doing something like that (not creating a session for the validator since form=fakeentry wont validate in php) i got slightly flamed lol.

Anyway i thought about it a bit and realised that -ve margin float is for rightbars, nor leftbars and i got rid of it and it now works fine in lots of browsers. Can anyone verify IE5m and Safari?

mindlessLemming
08-14-2004, 02:06 AM
surely it wont validate then though?
if the width has to be bigger than the negative margin, whats the point? wont it just cause an overlap (goes to try it)
aww damn, you guys seemed so sure it'd work - still no juice with 10em and -9.9em margin
Hmmm... for the sake of argument, try a pixel width instead of em's...
The reason I suggest this is that I know IE needs that overlap. Check out this layout (http://www.pmob.co.uk/temp/3colfixedtest_explained.htm), it uses that technique and includes a decent explaination.

bradyj
08-14-2004, 02:25 AM
Safari looks good -- IE menu looks good. IE mac does other issues, that you may know of --aside from not seeing secondary navigation:

ReadMe.txt
08-14-2004, 03:19 AM
ah well, seems to be ignoring my background images - prolly because those elements are empty - the image replacement technique i use seems to break on that too.

While your here would you mind checking http://readmetoo.co.uk?stylesheet=Default in saf and IE5m? be nice if there were a way to emulate an os X environment and do this myself, but alas not.

bradyj
08-14-2004, 03:32 AM
IE looks the same as safari (and mozilla builds) except two things:
1. The 'Go' styled button is wider than the whole menu bar :confused: , not this way in the others, it actually overlaps
2. secondary menu isn't showing

bradyj
08-14-2004, 03:34 AM
the menu right border is missing also:

jkd
08-14-2004, 04:06 AM
Forgive me here, but I still don't zoom fully. Why do you need to declare it as a 'layout' for this to work in IE? I understand the purpose that it is an IE bug, so to speak -- but what does it actually do? Is it just telling this browser "This is now an active layout"... it confuses me slightly :confused:

Unless an element as those particular css properties defined, IE doesn't do.... something? with them. Maybe additional rendering processing. It's some real obscure thing, I can't really explain it other than that some elements "have layout" and others don't, and that many CSS errors are really caused by elements not having "layout". Eh, whatever, I just think of it as some voodoo fix.

mindlessLemming
08-14-2004, 05:53 AM
be nice if there were a way to emulate an os X environment and do this myself, but alas not.

On the contrary.... http://pearpc.sourceforge.net/
Though it's stability and speed still leave a bit to be desired. I haven't set it up myself, but my father took a crack at the first release and he said it took him approx. 4 hours to get it running smoothly. Ouch! :eek:

JKD: Thanks for bringing this hasLayout garble to my attention. I've spent the morning going over old projects and examples of bugs I have filed away to see where it helps. ATM it seems to me that this magic bullet (zoom:1.0;) is more suited to IE<6, as when I applied it to a complex elastic layout it fixed IE 5.01 and 5.5, but IE 6 spat up it's lunch. I haven't been able to replicate the 'dissapearing bullets' issue bought up in the thread I linked to earlier, however it does seem to fix IE's notorious "creeping text" in all instances that I have checked.

bradyj
08-14-2004, 06:11 AM
On the contrary.... http://pearpc.sourceforge.net/
Though it's stability and speed still leave a bit to be desired.

Abomination :eek: Mac on a PC platform, I feel light headed and faint of heart :(

edit: If it's Linux users, well, that's ok then:) but I saw an XP shot in there, that's just not proper.

mindlessLemming
08-14-2004, 06:16 AM
Read it and weap Brady :p
Your beloved OSX running under XP :D

jkd
08-14-2004, 06:21 AM
Free download vs. $2568 for my new 15" powerbook.... I dunno. Tough decision.

bradyj
08-14-2004, 06:26 AM
Free download vs. $2568 for my new 15" powerbook.... I dunno. Tough decision.

Ok that made me laugh:) But we're still talking sacriledge here :D I'm pretty sure there's an Apple Inquisition somewhere near Redmond...

jkd
08-14-2004, 06:35 AM
Ok that made me laugh:)

Really? It made me cry when I had to give them the credit card info... :(

bradyj
08-14-2004, 06:55 AM
don't feel bad -- I still have a Biege box in here that works since 95 -- running OS 9, never had to replace a part, and have used it off and on as an email server and the like. You'll get your money's worth. And, cmon, isn't it pretty? You can admit it...

jkd
08-14-2004, 07:07 AM
don't feel bad -- I still have a Biege box in here that works since 95 -- running OS 9, never had to replace a part, and have used it off and on as an email server and the like. You'll get your money's worth. And, cmon, isn't it pretty? You can admit it...

Maybe when I get it. Until then, I despise Apple for emptying my bank account. ;)

bradyj
08-14-2004, 07:16 AM
Every year they come out with something new, and every year I hate them because I can't buy it. It's a love hate relationship, be sure of it.

mindlessLemming
08-15-2004, 01:12 AM
Every year they come out with something new, and every year I...put another brightly coloured fan in my home made PC :p

rmedek
08-15-2004, 01:29 AM
I gotta say... I just got a 17" Powerbook G4 laptop. My main monitor has my OSX display and I have a second monitor displaying XP using Virtual PC. Holy moly. It started as a mobile Pro Tools unit but has evolved into one hell of a web-testing machine....

ReadMe.txt
08-17-2004, 01:21 AM
meh, i got that pearPC running and now have available the following for testing on the 3 machines i have here:
FireFox0.8, FireFox0.9.3, Moz 1.8a2, Ie5w, IE5.5w, IE6w, Opera 7.21, Safari 1.2 and that stupid amaya thing the W3C made...

just need to find somewhere to get IE5m downloaded.

bradyj
08-17-2004, 01:37 AM
browser archive:
http://browsers.evolt.org/

And here's the most recent:
http://browsers.evolt.org/?ie/mac/5.2.3_OS_X

ReadMe.txt
08-18-2004, 01:32 AM
thanks, V nice site, any ideas how many of them it's worth testing sites on?

and on a side note, does anyone have a decent looking site that actually works on amaya?

bradyj
08-18-2004, 01:48 AM
thanks, V nice site, any ideas how many of them it's worth testing sites on?

and on a side note, does anyone have a decent looking site that actually works on amaya?

I stear clear of Amaya -- if you're going to test Mac, just stick with Safari, Mac IE, Firefox and Opera 7.5 -- nobody uses the others anymore... all that iCab has to offer is horrendous, and OmniWeb is the exact same webcore as Safari -- what's 'V nice site'?

ReadMe.txt
09-21-2004, 10:18 PM
heh, took me a few mins to remember what i meant, V = very and it makes sense lol.

AaronW
09-21-2004, 11:08 PM
Apparently it took you over a month. Ha!

ReadMe.txt
09-21-2004, 11:15 PM
i was looking through my visitor logs and i got a referal from this page yesterday, when i looked at it i noticed there was the question about the V.

AaronW
09-22-2004, 01:02 AM
Well I didn't actually think you sat on the reply page for a month pondering the meaning of the "V" :p



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum