X10nD X10nD - 5 months ago 9
CSS Question

center a div box

I want to center a div container on a page, in the css I am using

margin-left:auto;


does not seem to work.

Anything goes here

Thanks

Answer

This should work:

margin:0px auto;

Or you can even try this if you want:

margin:auto;
position:relative;
width: 600px; /* or whatever width */