Why does this CSS margin-top style not work?

前端 未结 12 1997
醉梦人生
醉梦人生 2020-11-21 04:54

I try to add margin values on a div inside another div. All works fine except the top value, it seems to be ignored. But why?

What I expected:
<

12条回答
  •  囚心锁ツ
    2020-11-21 05:30

    Not exactly sure why, but changing the inner CSS to

    display:inline-block;
    

    seems to work;

提交回复
热议问题