Basic HTML CSS question.

Discussion in 'Web Design and Development' started by Cabbit, Jun 27, 2008.

  1. Cabbit macrumors 68020

    Cabbit

    Joined:
    Jan 30, 2006
    Location:
    Scotland
    #1
    Is is possible to have a two divs, one that has a fixed width and the other that has a flexible width inside a container div that is also flexible.

    [​IMG]
     
  2. 7on macrumors 601

    7on

    Joined:
    Nov 9, 2003
    Location:
    Dress Rosa
    #2
    HTML:
    <div id="container" style="width:100%;">
           <div id="leftbox" style="width:200px; float:left;">
           Fun
           </div>
           
          <div id="rightbox" style="width:auto; float:right;">
          <hr style="width="100%">
          </div>
    </div>
    
    That's how I would do it. replacing the Fun and <hr> appropriately.
     
  3. wolf359design macrumors newbie

    Joined:
    Jan 31, 2007
    #3
    yes. but would you even need the container div?

    Ed
     
  4. kgarner macrumors 68000

    kgarner

    Joined:
    Jan 28, 2004
    Location:
    Utah
    #4
    You would if you wanted both of those divs to be less than the full width of the browser window. E.g. you want the design centered int he window and to occupy 75% but you want the sidebar to be fixed width and the other to fill the remainder of the area.
     
  5. wolf359design macrumors newbie

    Joined:
    Jan 31, 2007
    #5
    Ok I agree, but her container is not fixed, so I am assuming she wants to use all of the window space.

    Ed
     

Share This Page