Float / Clear Problems

Discussion in 'CSS' started by dtm32236, May 14, 2009.

  1. #1
    Hey guys...
    I'm having a problem with floating objects, maybe someone here can help.

    The basic format of the site is this:

    
    <div id="leftNav">
      left navigation
    </div>
    
    <div id="mainContent">
      main content
    </div>
    
    HTML:
    CSS:
    This works fine to have the two columns (navigation on left, all content on right).

    BUT - in the main content, I often have to float elements which means that I also have to clear them. But when I clear anything, it drops below leftNav. Check out the screenshot if it's unclear what I'm talking about.

    I've tried a million different things, including adding float:none; to the mainConent div, but nothing I do works. Does anyone have any ideas?

    Thanks a lot,
    Dan
     

    Attached Files:

    dtm32236, May 14, 2009 IP
  2. dtm32236

    dtm32236 Guest

    Messages:
    320
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Nevermind, I got it.

    Adding overflow:hidden to #mainContent worked!

    Thanks anyway...
     
    dtm32236, May 14, 2009 IP