Search code examples
csslayouthtmlpositioning

CSS - positioning divs from left to right


I want the black and white squares that share a tile/cell to overlap. The tile/cell blocks (There will be more, ideally) should fill the container of arbitrary size from left to right before going to the next row. What am I doing wrong? I thought left to right was default, but I know I am overriding some defaults with absolute positions.

http://jsfiddle.net/Hc7af/

Thanks!


Solution

  • .cell{
        ...
        float: left;
    }
    

    Is this what you mean?

    Also if you change the p element to a div it will fix the no-wrapping issue. I suspect it has to do with default styles.