Log in

View Full Version : Float and margin: 0 auto...



Mad_Griffith
06-27-2012, 12:56 PM
I am editing a template here (http://nl.italiethuis.com/category/territory/lazio/). Basically the articles should be vertically aligned to the header elements... The header elements are centered with the "margin: 0 auto" property/values. I am trying to do the same with the div containing the articles but to no avail, as the div itself is floating left...

Thank you very much for your suggestions...

keyboard
06-27-2012, 09:11 PM
Are you trying to get two or more things on the same line? (Hence the float:left;)
An alternitive to float:left; that allows multiple divs on the same line and centering them is display:inline-block;

Try it out...

bernie1227
06-27-2012, 09:16 PM
Are you trying to get two or more things on the same line? (Hence the float:left;)
An alternitive to float:left; that allows multiple divs on the same line and centering them is display:inline-block;

Try it out...

Just expanding on what keyboard said, float left actually takes things out of the flow of the page, therefore allowing them to be next to each other.