I have something like this: <div id="container"> <div id="one">Some text </div> <div id="two">Another text </div> </div> HTML: and in the IE browser I have a small space on the output between "one" and "two", that isn't on Firefox. I put all of these zero: margin, padding, border, but the space is still there, and only in IE. What's the problem? Thank you.
try <div id="container"> <div id="one">Some text</div><div id="two">Another text</div> </div> Code (markup): just like that IE looks at a physical line break and ads a space thinking its doing the right thing so you must keep them on the same physical line.
Every browser has its own defaults for things like margin and padding. Since changing code to make one browser look right often screws up another, we set everyone to 0 so that we're starting from the same point for everyone. This might screw with other parts of your page if you were relying on default margins and padding on other elements, but you can add this: * { margin: 0; padding: 0; } body { margin-bottom: 10px; <-- I'd make this padding-bottom instead, but that's me background-color: #eee; } Code (markup): The * means "everything" so then you don't need to say margin: 0 padding: 0 on everything (biggest problem between browsers is lists, so I really love this for lists).
Just had a play with your page. I moved the </div> for the "top_picture" onto the same line as the <div> for that section and the space disappeared. It now looks like below and works well Hope this helps Web-Master
Brother you have right. I thought that doesn't matter how I have the code arranged, but I saw that I was wrong. Thank you
And yet I don't have a single extra space in any page I've coded, and almost all of my divs are not written inline but as so: <div> stuff more stuff etc </div> It does not normally matter, because the browser is supposed to ignore whitespace in code. So I'm still assuming it's some default margin or padding in IE.
Brother believe me that I tried almost everything, even with *, like you said, but web-master gave me an idea and worked. I think like you, because it's the first time when I have this problem, and always I don't care too much how I put the code.
Hey if it works, use it! But it would bother me if it happened to me because I'd want to know what's causing it... since it's an image it occurred to me that it might be that bit of space at the bottom of all inlines (making room for hanging letters like g and p) where either display: block or vertical-align: bottom also removes the space, and tends to show up in IE rather than other browsers.