treehouse : what would you like to learn today?
Web Design Web Development iOS Development

css positioning

  • Morning all,

    I am working on a layout for my shopping cart and am in need of some help. I first started out using a table but I would like to use CSS as it loads faster than a table. Toward the bottom of the page I have Canned dog food where you can see what is going on. I would like to use CSS to position all the foods and then the cart buttons. If I have to use tables that is fine I just wanted to use CSS to style it and load faster. Thanks in advance.

    http://www.barksandbones.com/dev2/bnbfood.php

    Tim
  • You mean make 2 columna. ?
  • Yes two column, unless I set the top margin to negative px I can't get it to align next to the div on the left. I've floated it and can't get it to line up.

    Thanks,
    Tim
  • Well it is a little bit hard . Writing from the iPhone but i will try. In fact what you want is very easy.

    Lets use ul and li

    ADDED



    #wrapper{margin:0 auto; padding:0; width: 960px;}

    .clear{clear:both;}

    #column1 ul{float: left; width:470px;margin:0.2em;padding:1.2em;}

    #column2 ul{ float: right; width:470px;margin:0.2em;padding:1.2em;}

    #column1 ul li { list-style:none;}

    #column2 ul li { list-style:none;}





    <div id=\"wrapper>
    <ul id=\"column1\">
    <li>product 1</li>
    <li>product 2</li>
    <li>product 3</li>
    </ul>


    <ul id=\"column2\">
    <li>product 1</li>
    <li>product 2</li>
    <li>product 3</li>
    </ul>
    </div>

    <div class=\"clear\"></div>

  • Sweet! Thanks I will give it a try!

    Tim