Why does break outside
when margin and padding is applied?

前端 未结 3 1608
礼貌的吻别
礼貌的吻别 2021-02-19 09:03

I know this is very basic CSS. How do I keep the span contained within the div? At the moment, the span extends outside the top and bottom of the div.

3条回答
  •  执念已碎
    2021-02-19 09:34

    Inline elements will not consume vertical padding and margin space. You can make the span display: block, but without more detail I don't know if that will achieve your goal.

提交回复
热议问题