Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.
Hi all, please see this major site announcement: https://www.boards.ie/discussion/2058427594/boards-ie-2026

Css float problem, dynamic widths

  • 19-08-2009 03: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
Advertisement