keep padding from making the element bigger?

前端 未结 2 581
你的背包
你的背包 2020-12-05 18:09

I have an element with a 70% width, and it is floating beside an element with 30% width, but when I add 25px of padding it expands the element and breaks the fo

2条回答
  •  爱一瞬间的悲伤
    2020-12-05 19:05

    I would create another element of the same type (may I guess it's a div?) inside the element and set that one to have a padding/margin of 25px.

    For example:

    Acctual content here.

提交回复
热议问题