Div layout problem

Discussion in 'CSS' started by hobbsy, Aug 22, 2007.

  1. #1
    Hey All

    I want two div's a 'leftMenu' with a fixed width: 200px....and a 'content' div next to the 'leftMenu' div which spans to the rest of the page as a % so that it continuasly takes up the whole rest of the page and shrinks to fit when the window is made smaller.

    My problem is that with the 'leftMenu' being fixed I can't find a way to give the 'content' section a % with out it taking up too much room and dropping down below the 'leftMenu' div or it being to small. This is because if i Assign it width:100% it takes it as 100% of the whole page not 100% of what is left between the edge of the 'leftMenu' and the rest of the page.

    There must be a simple way to get this to work just can't find it...

    PLEASE HELP
     
    hobbsy, Aug 22, 2007 IP
  2. GWiz

    GWiz Peon

    Messages:
    359
    Likes Received:
    17
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Here's what I got after a 10 second search of google...

    http://www.google.ca/search?hl=en&client=firefox-a&rls=org.mozilla%3Aen-US%3Aofficial&hs=ZKY&q=css+2+columns&btnG=Search&meta=

    Examples:
    http://www.glish.com/css/9.asp
    http://bluerobot.com/web/layouts/layout1.html
    http://realworldstyle.com/2col.html
     
    GWiz, Aug 24, 2007 IP
  3. Dan Schulz

    Dan Schulz Peon

    Messages:
    6,032
    Likes Received:
    436
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Get rid of the percentage, set the menu to float: left and apply a left margin to the content DIV.
     
    Dan Schulz, Aug 26, 2007 IP