I have the following problem. I have a container that reacts so that it will be the width of the browser. Or, when the browser is large enough, a sidebar will appear next to it.
Inside this div, I have about 10 elements with the following css:
display:block;
width:200px;
height: 200px;
background: tomato;
margin: 10px;
float:left;
Thus, they form a grid.
At this point, it happens that when the div container is 440px wide, for example. They will smile beautifully 2 on each row. But when the width of the container is 600, for example. still 2 diplayed with a large white area on the left.
Now I want to focus them. Therefore, 2 must be centered in the container. I would do this by adding another container that warps the elements and giving it margin: auto; But this does not work:
Fiddle: http://jsfiddle.net/kqvcnugs/
, , ?
!