Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Mar 2012
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    How to make divs line up?

    Hi.

    Please take a look at this JSFiddle CSS, and see if you can tell me why the divs are not all the same size in width!
    http://jsfiddle.net/zugzwangle/QB2WT/
    Thanks

    Zugz

  • #2
    Regular Coder
    Join Date
    Dec 2006
    Posts
    177
    Thanks
    7
    Thanked 0 Times in 0 Posts
    The CSS5 border shading affects it somehow I believe.

    Also, your left/right positions aren't the same, the div with the most spacing
    try using relative positioning instead of positive and it'll clear up so much of your problems.
    Last edited by nolvorite; 08-13-2013 at 05:24 AM.

  • #3
    New Coder
    Join Date
    Aug 2013
    Posts
    25
    Thanks
    2
    Thanked 2 Times in 1 Post
    Try this:-
    <html>
    <head>
    <meta http-equiv="content-type"
    content="text/html; charset=ISO-8859-1">
    <title>Whatever</title>
    <meta name="author" content="Whomever">
    <style type="text/css">
    #NavLayer {
    position: absolute;
    width: 100%;
    background-color: blue;"
    }
    </style>
    </head>
    <body>
    <div id="NavLayer">
    <table align="left" cellpadding="0" cellspacing="5" border="0"
    width="100%">
    <tbody>
    <tr>
    <td width="" valign="top" align="center">table</td>
    <td><br>
    </td>
    </tr>
    </tbody>
    </table>
    </div>
    <div style="position: relative; width: 100%; background-color: red;"
    align="center">
    test<br>
    test
    </div>
    </body>
    </html>


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •