Position div box at the end of after ensuing elements

前端 未结 4 957
情书的邮戳
情书的邮戳 2020-12-21 02:08

If I have 3 Div boxes (any number really) ordered in the following manor:

4条回答
  •  清歌不尽
    2020-12-21 02:23

    If you control the dimensions of the divs and are sure that their contents will not break your layout,you could position them with css. A bit awkward, but something like:

    #one, #two, #three {
       position: absolute;
       width: 200px;
       height: 200px;
    }
    #one {
       top: 400px;
    }
    #two {
       top: 0px;
    }
    #three {
       top: 200px;
    }
    

    These positions could then be changed with javascript if you need to.

提交回复
热议问题