Search code examples
csshtmlcss-tables

Div positioning to low in an HTML table


I am facing a div positioning problem.

Here is the fiddle to depict my problem : http://jsfiddle.net/YbJ2q/11/

How can I align the red div blocks in my table cell without using the CSS property "margin: -20px"?


Solution

  • Your issue lies in that you're not setting the vertical-align of your TD's to top.

    Example:

    http://jsfiddle.net/YbJ2q/13/

    (I changed your margin-top to 10px)