Floating Centered

Discussion in 'CSS' started by Skunk, Jan 28, 2008.

  1. #1
    Hi, I'm very new to CSS, and I'm trying to code my first template together. I've run into a snag I believe though. Basically I have 3 boxes that I want side by side together that span 760 pixels. I've written the code for them but I think something is wrong with my float not centering? Here's my code so far, maybe someone can tell me what I'm doing wrong?


    #leftbar {
    background: blue;
    float: left;
    width: 259px;
    }

    #middlebar {
    background: darkgreen;
    float: center;
    width: 228px;
    }

    #rightbar {
    background: green;
    float: right;
    width: 273px;
    }
     
    Skunk, Jan 28, 2008 IP
  2. Skunk

    Skunk Well-Known Member

    Messages:
    528
    Likes Received:
    28
    Best Answers:
    0
    Trophy Points:
    118
    #2
    Wait, nevermind, I think that I figured it out. I just changed center to left. Is this the correct way to do it?
     
    Skunk, Jan 28, 2008 IP
  3. babyboy808

    babyboy808 Well-Known Member

    Messages:
    491
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    125
    #3
    babyboy808, Jan 28, 2008 IP
  4. just-4-teens

    just-4-teens Peon

    Messages:
    3,967
    Likes Received:
    168
    Best Answers:
    0
    Trophy Points:
    0
    #4
    having 2 float left and one right should work, also having all 3 float left would work too!
     
    just-4-teens, Jan 28, 2008 IP
  5. Skunk

    Skunk Well-Known Member

    Messages:
    528
    Likes Received:
    28
    Best Answers:
    0
    Trophy Points:
    118
    #5
    Thanks for the link, I'll fool around with it later. I'm running through a tutorial and my template is differently set up that theirs so I just hit a snag at that point, but some trial and error fixed it. I simply made the center one left and it's working out. Thanks again for the help.

    If I run into any more problems I'll post them in here so I don't spam the whole board up. Thanks!
     
    Skunk, Jan 28, 2008 IP
  6. Skunk

    Skunk Well-Known Member

    Messages:
    528
    Likes Received:
    28
    Best Answers:
    0
    Trophy Points:
    118
    #6
    I've got another BIGGER issue. I can't get any images to show up when I try to put them in place. Here's the code I'm using for my header and it's just not working:

    #main-nav {
    height: 54px;
    background-image: url("/images/headers/header.gif");
    }

    Any idea what I'm doing wrong here?

    I've tried on the other images too and I can't get it to work.
     
    Skunk, Jan 28, 2008 IP
  7. just-4-teens

    just-4-teens Peon

    Messages:
    3,967
    Likes Received:
    168
    Best Answers:
    0
    Trophy Points:
    0
    #7
    just-4-teens, Jan 28, 2008 IP
  8. Stomme poes

    Stomme poes Peon

    Messages:
    3,195
    Likes Received:
    136
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Or at least, if nothing shows up after you've loaded the page to the server, try to view the images directly. This always helps me catch when I either forgot to upload the images, or misspelled their names, or put them somewhere else.
     
    Stomme poes, Jan 29, 2008 IP