Skip to content Skip to sidebar Skip to footer

Aligning Divs Center Next To Eachother With Valign: Top

Take a look here http://www.basenharald.nl/3d. For the home part i put on some black borders so you can see what i mean. The problem: I need to position the 2 blocks (the 'hey'bloc

Solution 1:

You're going to have to rethink your design strategy. Here's a few pointers:

  • Use divs instead of lists to layout your page (lists are good for menus, etc)
  • margins can only be used once per class
  • use div floats to position your divs side by side
  • store your javascripts externally this way your code will be cleaner

Now for your question this is what you're looking for to position your elements:

<div id="wrapper" style="position: relative; margin: 0 auto; width: 800px; text-align: left">
<div id="leftcol" style="float: left; width: 400px;">left column</div>
<div id="rightcol" style="float: left; width: 400px;">right column</div>
</div>

Finally I would make sure and validate my code and you can do so here: http://validator.w3.org/

Hope this helps.

Post a Comment for "Aligning Divs Center Next To Eachother With Valign: Top"