evan
evan

Reputation: 964

Margin: 0 auto; not working

Here is the fiddle: http://jsfiddle.net/Tb3sF/.

I looked at this post.

I've tried the code below (using and not using: display:block and different widths.)

.form {
   display: block;
   margin: 0 auto;
   width: 700px; 
}

Thanks!

Upvotes: 0

Views: 648

Answers (2)

Josh Crozier
Josh Crozier

Reputation: 240938

It is centering with margin:0px auto, however, since it is 700px, you are not seeing that it is centered within such a small window.

Try and lower it to something like 300px; see jsFiddle here

Alternatively, you can just use text-align:center; jsFiddle here

Upvotes: 3

Conqueror
Conqueror

Reputation: 4433

It is working, if you stretch the fiddle window, you can confirm that. Also, if you change the width to a smaller size you can also confirm it. Try adding a border, it will help you out with the visualization.

Upvotes: 1

Related Questions