Absolute positioning ignoring padding

后端 未结 3 1347
情书的邮戳
情书的邮戳 2021-01-11 13:19

I am trying to position a div with buttons at the bottom of a parent div that has a padding.

The expected result is having the button resting on top of the

3条回答
  •  日久生厌
    2021-01-11 14:02

    Absolute positioning does not take padding into account. A possible solution would be to add another container inside .mcontainer, that also has position: relative. That way, the inner container would respect the padding, and the absolute positioned element would be at the bottom of the inner container.

提交回复
热议问题