Overlay Divs Without Absolute Position

前端 未结 7 1499
旧时难觅i
旧时难觅i 2020-12-24 01:36

What follows is a long explanation, but it\'s the only way to effectively communicate the issue I\'m trying to resolve...

I am (somewhat desperately, and entirely un

7条回答
  •  被撕碎了的回忆
    2020-12-24 01:59

    Got it!!! :D

    Pure Css solution Very Easy. Put the following.

    #main {
    float: right;
    overflow: visible;
    position: relative;
    z-index: 1000;
    height: 177px;
    width: 100%;
    }
    

    Replace whatever you have in css #main with what i have done above.

    So remove the following:

    display: inline;
    position: relative;
    z-index: 0;
    

    Explanation: Main idea here is to float the main element, make it of certain height so at no point it pushes everything down. But make overflow of it visible. Overflow of content doesn't affect siblings of main element.

提交回复
热议问题