CSS positioning to fill container: width vs. left/right?

前端 未结 4 1693
梦如初夏
梦如初夏 2020-12-16 11:49

Considering:

  • For elements that are absolutely positioned inside a relatively positioned container.
  • If you want the element to fill the width of the co
4条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-16 12:53

    Both of the solution is working in every browser without any problems. In these cases I like to add a width: 100%; left: 0; bottom: 0; for the element, but if you like left:0;right:0; bottom:0; more, than you can use that, too.

提交回复
热议问题