Problem:
I want to center the containing div, but I want to also left-align the blocks. I think flex boxes might be the solution, but I'm not sure what to do with them. I want to do this:
- without Javascript
- without tables
- without setting a row width (the row width must be dynamic.. that's the intent of this exercise)
- without setting a width to the container. (same as setting a row width)
- without adding invisible divs. (same as setting a row width)
Example, with current CSS (attempt failed):
.block {
border : 5px solid DarkRed;
width : 150px;
height : 150px;
display : inline-block;
}
.container {
display : inline-block;
text-align : center;
}
Edit: here is a Javascript version to show how it should look like: http://jsfiddle.net/SKRjG/8/