Help with DIV Positioning

Discussion in 'CSS' started by MotocrossJoe88, Aug 2, 2010.

  1. #1
    I've got two Div's that I need to fit on top of each other without overlapping.

    The top one needs to be aligned to the top left, and the one underneath needs to be aligned directly underneath the top div, all the way to the left as well.

    Here's a small example:

    ----------
    |--------|
    ----------
    |--------|
    |--------|
    ----------

    I'm pretty rusty with my coding, it's been about a year since I've written any.

    http://www.devolv.com is where I'm working, it works fine in Chrome but the alignment of the bottom div is wrong in other browsers; it's too high.

    You can take a look at my source code, all the code is in the one .php file. I'll move it all to a stylesheet once I get it figured out, and I apologize for its messiness.

    Thanks.
     
    MotocrossJoe88, Aug 2, 2010 IP
  2. Divisive Cottonwood

    Divisive Cottonwood Peon

    Messages:
    1,674
    Likes Received:
    35
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I'm not 100% sure what you mean, but why don't you place all your CSS in an external file rather than inline? It makes it very difficult for others to offer a solution if they can't read the code properly
     
    Divisive Cottonwood, Aug 3, 2010 IP
  3. pmek

    pmek Guest

    Messages:
    101
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #3
    It is hard to say without seeing any code, but try something like this -

    
    <style type="text/css">
        #outerdiv { width:200px; overflow:hidden; }
        .innerdiv { float:left; display:inline; clear:both; width:200px; }
    </style>
    
    <div id="">
        <div class="innerdiv"></div>
        <div class="innerdiv"></div>
        <div class="innerdiv"></div>
    </div>
    
    
    Code (markup):
    I hope this helps.
     
    pmek, Aug 6, 2010 IP