how to overlap two div in css?

前端 未结 4 1697
攒了一身酷
攒了一身酷 2021-01-04 00:47

I have two div likes ,

and css

相关标签:
4条回答
  • 2021-01-04 01:24

    check this fiddle , and if you want to move the overlapped div you set its position to absolute then change it's top and left values

    0 讨论(0)
  • 2021-01-04 01:25

    See demo here you need to introduce an additiona calss for second div

    .overlap{
        top: -30px;
    position: relative;
    left: 30px;
    }
    
    0 讨论(0)
  • 2021-01-04 01:26

    I edited you fiddle you just need to add z-index to the front element and position it accordingly.

    0 讨论(0)
  • 2021-01-04 01:42

    add to second div bottomDiv

    and add this to css.

     .bottomDiv{
           position:relative;
           bottom:150px;
           left:150px;
        }
    

    http://jsfiddle.net/aw8RD/1/

    0 讨论(0)
提交回复
热议问题