Strange margin issue with a display: inline-block child

前端 未结 4 1866
温柔的废话
温柔的废话 2020-12-19 17:19

Heres the fiddle

When I set #two to inline-block it subtracts the 16 px of top/bottom margin from the

and adds it to the divs c

4条回答
  •  南方客
    南方客 (楼主)
    2020-12-19 17:49

    Paragraphs have margins built in (in most browsers).

    Try this:

    p 
    { 
        margin: 0px; 
    }
    

提交回复
热议问题