How do I automatically stack divs vertically inside a parent?

前端 未结 6 1512
遇见更好的自我
遇见更好的自我 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:13

    Div elements are block elements, which means that they will take a full row and that any element next to them will skip a line. Just do:

    If that does not work, you probably need to put them in display: inline-block;

提交回复
热议问题