html - overflow:auto causes the absolute elements of child DIV disappeared -


i have div 'a' in have set overflow: auto. inside div, have 2 divs: parent div b set position: relative , child div c position: absolute,

now issue that, setting overflow: auto on div makes div c disappear.

i have created fiddle can explain issue.

<body style="float:right">  <div id="a" style="overflow:auto;max-height:100px;width:200px;text-align:right"> <div id="b" style="position:relative">a text  <div id="c" style="position:absolute;left:-200px;width:200px;background-color:grey">   <div id="d">this text getting disappeared after setting overflow:auto on parent div id="a"   </div><!-- end of div id="d" -->   </div><!-- end of div id="c" -->   </div><!-- end of div id="b" -->     </div><!-- end of div id="a" -->    </body> 

not sure why happening, highly useful

maybe here see why disappears... @ div #a... gave border can see visible area.

body {      float: right;  }    #a {      /* overflow: auto; */      max-height: 100px;      width: 200px;      text-align: right;      border: 1px solid red;  }    #b {      position: relative;  }    #c {      position:absolute;      left: -200px;      width: 200px;      background-color: grey;  }    #d {        }
<div id="a">        <div id="b">a text            <div id="c">                      <div id="d">                text getting disappeared after setting overflow:auto on parent div id="a"            </div><!-- end of div id="d" -->                      </div><!-- end of div id="c" -->        </div><!-- end of div id="b" -->    </div><!-- end of div id="a" -->


Comments

Popular posts from this blog

javascript - Thinglink image not visible until browser resize -

firebird - Error "invalid transaction handle (expecting explicit transaction start)" executing script from Delphi -

mongodb - How to keep track of users making Stripe Payments -