I have a scenario while writing an html code.. that inbetween some floating divs... there comes two divs with absolute positioning.. and Ive created a sample jsfiddle to show the issue.. try entering a long text like for example "CSS overflow hidden with absolute position · how do I prevent ... Size of overflow:hidden div with position:absolute one inside · CSS/HTML ...".. and clickon submite button...it will get appended in the mainContainer... since the text is too long and that container div is set to auto..it will extend and go behind the textbox container div.. is there anyway I dould make the textbox container to move down according to the height needed for the main container to get visible area and then move back up if not needed.. im using the absolute positioning due to one factor..as when I add width:100% in css.. that div usually leaves a gap between left margin and the start of that div... and it appears as a blank space.. please check the fiddle..
HTML Enter
CSS
#mainContainer{
width:50%;
height:auto;
position:absolute;
left:0;
top:20px;
background-color:#000000;
color:#ffffff;
font-size:19px;
}
#textboxContainer{
position:absolute;
width:100%;
height:100px;
background-color:green;
top:60px;
left:0;
}
#inputBox{
width:80%;
}
</p>