0

Well, everything seems to be positioned and I don't understand why the child div's margin is outside of its parent's content :

As highlighted with firebug

With calculated style of parent:

calculated style of parent

And of child:

calculated style of child

Can you tell me what's wrong ?

lvr123
  • 524
  • 6
  • 24
  • 2
    Post your HTML and CSS – Asons Apr 16 '16 at 15:14
  • `position` not set? `line-height` set to `28px` could also affect display – guest271314 Apr 16 '16 at 15:14
  • Please post a JSfiddle so that we can work on your problem. – geeksal Apr 16 '16 at 15:16
  • 3
    Looks like margin collapsing, see [how to fix it](http://stackoverflow.com/questions/19718634/how-to-disable-margin-collapsing). – Stickers Apr 16 '16 at 15:17
  • 1
    @Pangloss : +1 you were right : margin collasping. I added an `overflow: auto` and the problem is solved. Thanks. I will take some time to understand exactly why and how this instruction solved my problem. – lvr123 Apr 16 '16 at 17:01
  • It can be a little confusing, but not very hard to understand, see - https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Box_Model/Mastering_margin_collapsing – Stickers Apr 16 '16 at 17:08

0 Answers0