Results 1 to 2 of 2

Thread: Div auto shifting to right - please help?

  1. #1
    Join Date
    Aug 2007
    Location
    MO USA
    Posts
    106
    Thanks
    37
    Thanked 0 Times in 0 Posts

    Question Div auto shifting to right - please help?

    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.

    Code:
    <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:

    Code:
    <style type="text/css">
    <!--
    
    #active_container{
    float:right;
    display:block;
    }
    #butt_inactive{
    float:right;
    }
    #butt_delete{
    float:right;
    }
    
    -->
    </style>

  2. #2
    Join Date
    Dec 2007
    Location
    Essex, UK
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    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

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •