I am trying to display an absolutely positioned div inside floating div.
Here is my HTML so far.
#outer
{
float:left;
width:500px;
border: 1px solid red;
}
#inner
{
left:0;
position:absolute;
border: 1px solid black;
width:100%
}
<div id='outer'>
<div id='inner'>
some text inside div
</div>
</div>
I have an outer div whose width is being set as percentage of its parent div. ‘outer’ div contains an absolutely positioned ‘inner’ div.
I want to make width of the inner div same as outer div which is not working. Can somebody suggest a way to do this?
Give
position:relative;to your#outerdiv. write like thischeck this http://jsbin.com/ifuxum/2/edit#html,live