0

code example

I set all margins equal to 0. I expected there would be no spaces between my div-cells. But as you can see from the picture, my expectations were failed. https://i.stack.imgur.com/A5aYj.png

I experimented and found out that the spaces disappear when margin is set to -3px. Can anyone explain to me this behavior?

1
  • 1
    It's better to post code as working text snippet, not image.
    – Vlad DX
    Nov 5, 2015 at 22:11

1 Answer 1

0

Believe it or not, the line breaks between the divs cause this (put all code in one line for proof).

One solution is to set font-size:0 on the outer div and set it back to normal on the inner ones.

1
  • yeah! it worked! thank you!
    – OlehZiniak
    Nov 5, 2015 at 21:41

Not the answer you're looking for? Browse other questions tagged or ask your own question.