how to make my container appear correctly

Discussion in 'CSS' started by driven, Jun 29, 2007.

  1. #1
    I'm not sure what I am doing wrong here on this site of mine, but I hope to get some feedback on this.

    But I have an issue;


    I need my container that holds the sidebar and main content to appear. Unfortunately, it doesn't show up correctly.

    /* ------------- content divisions --------------- */
    #container {
      width: 800px;
      background-color: #333;
      padding: 20px auto;
    
    }
    	
    #content {
       float: right;
       width: 570px;
       color: #000;
       line-height: 140%;
       text-align: left;
    }
    
    Code (markup):
     
    driven, Jun 29, 2007 IP
  2. veckd

    veckd Peon

    Messages:
    1,065
    Likes Received:
    23
    Best Answers:
    0
    Trophy Points:
    0
    #2
    looks fine to me.
     
    veckd, Jun 29, 2007 IP
  3. kk5st

    kk5st Prominent Member

    Messages:
    3,497
    Likes Received:
    376
    Best Answers:
    29
    Trophy Points:
    335
    #3
    You need for #container to enclose its float children.
    
    #container {
      width: 800px;
      background-color: #333;
      padding: 20px auto;
      position: relative;
      [color=red]overflow: hidden;[/color]   /*[color=blue]add this line[/color]*/
      margin-top: 10px;
    }
    Code (markup):
    Why the dark gray background with black text? Do you mean to give #container's children a different background color?

    cheers,

    gary
     
    kk5st, Jun 29, 2007 IP