cannot eliminate space between 2 horizontal divs inside containing div

后端 未结 5 919
孤独总比滥情好
孤独总比滥情好 2021-02-04 16:00

Should be easy, right? Just set the outer containing div\'s padding to zero, and set the two side-by-side divs inside the outer div to have margin:0 but that\'s having no effe

5条回答
  •  执念已碎
    2021-02-04 16:29

    Like @Juan Lanus said in his answer, it is the whitespace causing your issue.

    An additional solution is to set font-size: 0px on the containing div.

    But you will need to then also set font-size: initial (or to a non-zero value) on the children div so you can still see your text.

提交回复
热议问题