You're trying to do too much with hard-coded dimensions. Let the browser lay out the elements and be sure to account for line-end characters as discussed in your other post.
Ok, Roy. I deserved that. I didn't explain the situation well enough. When the above code is put in IE, the span (328px) and image (170px) won't fit side-side in the div (500px), though there should be 2 pixels to spare between them. When I decrease the span from 328 to 327, they fit. So, there are 3 pixels of "Unidentified Whitespace" between them.
As it turns out, I later came across a discussion thread where someone described a famous "3 pixel jog" in IE that occurs when a floated element is placed next to a non-floated element. I floated both elements and they fit as expected.
Bear, this code wasn't actually something I was trying to write for some production use. I came across the issue haphazardly during some CSS/DOM study and needed an answer to validate/refute/add-to what I learned.
Roy Ivar Moe
Greenhorn
Joined: Jun 22, 2006
Posts: 21
posted
0
I observed the same behaviour when I tried your example in IE and in FF. Sorry, can't tell you what causes this though. Probably another IE bug, right?
Regards, Roy
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.