How do I automatically stack divs vertically inside a parent?

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

    A div should already display as a block and take up a full "row". Here is some HTML and CSS to give an example, compare it to your code:

    http://jsfiddle.net/mWcWV/

    Foo
    Bar
    Baz

提交回复
热议问题