‘Div’ and ‘Input’ tag acting differently

I am making a search tool, and the search bar was originally a div, and everything was fine, but when I change it to input tags, the margin on the left disappears. Can someone please explain why this might be happening.

Here’s my code (with header HTML removed for security reasons): http://jsfiddle.net/k3pv5cmh/

I have tried margin: auto, margin: 0 auto, and margin-left: auto with margin-right: auto. But none of these fix the problem.

On the JS Fiddle you can change the input tags to div tags and see the difference.


Source: html5

Leave a Reply