Reputation: 1600
I have table element and div element positioned next to each other. Both are wrapped in another div .
Her is an example : http://jsfiddle.net/7Ge4h/
<div>
<table id="table-inside-div">
<tr>
<td><div>Table inside the div</div></td>
</tr>
<tr>
<td><div>Table inside the div</div></td>
</tr>
</table>
<div id="div-inside-div">
<span style="background:red">Div inside the div</span>
</div>
</div>
When I resize the output window horizontally and the table and the div get next to each other as close as possible the div goes beneath the table but I want it to just go over the table if it was with fixed position. How can I do that?
Upvotes: 0
Views: 343
Reputation: 4742
You can add an id to the parent div
and set position to relative
then the #div-inside-div
to absolute
#main{
position:relative;
}
#table-inside-div{
float:left;
background: yellow;
width:200px;
}
#div-inside-div{
float:right;
width:200px;
position:absolute;
right:0px;
}
Upvotes: 0