Log in

View Full Version : Div auto shifting to right - please help?



me_myself
12-06-2007, 08:23 PM
I have a container div and within the container i have two div's and within each of the div i have an image. The container div (and its sub) are placed in a table - inside a TD (it has align right). My problem is when i set visibility:hidden to one div, the other div should move to the right (like if you place two images in a td without any div and delete one image).

Please let me know how to achieve this using CSS.



<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="right">
<div id="container">
<div id="butt_1"><img src="images/button_1.gif" /></div>
<div id="butt_2"><img src="images/button_2.gif" /></div>
</div>
</td>
</tr>
</table>[


CSS i've used:



<style type="text/css">
<!--

#active_container{
float:right;
display:block;
}
#butt_inactive{
float:right;
}
#butt_delete{
float:right;
}

-->
</style>

JohnRostron
12-09-2007, 11:13 AM
Visibility only determines whether you can see it or not. It is still there. What you need is display. Display can be set as none, in which case it takes up no space.

John rostron