How do I automatically stack divs vertically inside a parent?

前端 未结 6 1610
遇见更好的自我
遇见更好的自我 2021-02-03 21:56

Here\'s what I am trying to accomplish...

  1. \"parent\" has position:relative
  2. \"div 1-3\" have position:absolute

However, whenever I do this,

6条回答
  •  感动是毒
    2021-02-03 22:22

    Just remove absolute positioning. Center the divs using margin:auto and then provide whatever vertical margins you like.

提交回复
热议问题