Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Css float problem, dynamic widths

Options
  • 19-08-2009 4:34pm
    #1
    Closed Accounts Posts: 248 ✭✭


    I have a 'content' div that contains two divs floated side by side. The first one is a fixed width, the second one needs to be able to change dynamically based on the width of the content div. The second one should expand out to the far edge of the content div.

    HTML -
    <div class="content">
      <div clas="left-side">
      </div>
    
      <div class="right-side">
      </div>
    </div>
    

    CSS -
    .content{
      width: 800px;
    }
    
    .left-side{
      float: left;
      width: 100px;
    }
    
    .right-side{
      float: left;
     ??????????
    }
    

    So what values should I put in .right-side to make it take up all available horizontal space? In this case it would be 800px-100px = 700px. But I can't set width to be 700px as I need it to fill the space dynamically cos the content div will sometimes have values other than 800px. Anyone got any ideas?


Comments

Advertisement