1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Aligning columns using css, help please.

Discussion in 'CSS' started by Faketrix, Sep 18, 2010.

  1. #1
    Hey guys,

    im having some issues getting my two columns to sit side by side.

    I have 2 with divs classes of .columnL and .columnR in my content div.

    The content width is 789px.

    Can you please tell me where i am going wrong with this?

    Heres the code:

    #content .columnL {
    width: 330px;
    height: 340px;
    background-image: url(assets/specialsbox.png);
    background-repeat: no-repeat;
    background-position: center;
    margin-top: 13px;
    margin-right: 0;
    margin-bottom: 24px;
    margin-left: 0;
    padding-top: 13px;
    padding-right: 0px;
    padding-bottom: 0;
    padding-left: 17px;
    }

    #content .columnR {
    width: 287px;
    margin-top: 13px;
    margin-right: 0;
    margin-bottom: 24px;
    margin-left: 0;
    padding-top: 0;
    padding-right: 30px;
    padding-bottom: 0;
    padding-left: 30px;
    }


    #footer {
    clear: both;
     
    Faketrix, Sep 18, 2010 IP
  2. alfa_375

    alfa_375 Active Member

    Messages:
    445
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    60
    #2
    Below code should work, I just added float:left property to your both columnL and columnR class for content.

    #content .columnL {
    float: left;
    width: 330px;
    height: 340px;
    background-image: url(assets/specialsbox.png);
    background-repeat: no-repeat;
    background-position: center;
    margin-top: 13px;
    margin-right: 0;
    margin-bottom: 24px;
    margin-left: 0;
    padding-top: 13px;
    padding-right: 0px;
    padding-bottom: 0;
    padding-left: 17px;
    background-color:#000;
    }

    #content .columnR {
    float: left;
    width: 287px;
    height: 340px;
    margin-top: 13px;
    margin-right: 0;
    margin-bottom: 24px;
    margin-left: 0;
    padding-top: 0;
    padding-right: 30px;
    padding-bottom: 0;
    padding-left: 30px;
    background-color:#000ccc;
    }


    #footer {
    clear: both;
     
    alfa_375, Sep 18, 2010 IP
  3. Faketrix

    Faketrix Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Thats aswsome, thanks for the quick reply! appreciate the help.
     
    Faketrix, Sep 18, 2010 IP
  4. alfa_375

    alfa_375 Active Member

    Messages:
    445
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    60
    #4
    You are Welcome!
     
    alfa_375, Sep 18, 2010 IP