Reputation: 3969
I am banging my head for quite a long time and don't what's going wrong with setting width of input elements.
Here 100px set width for submit button
Here same 100px is set to text field
And you can check the difference of width. It seems one is following quirks mode BUT WHY when same doctype is set?
Is it a bug in FX/Chrome?
Upvotes: 2
Views: 124
Reputation: 7041
by adding a box-sizing:border-box
to input text will solve it.
because the default calculate width and height without the border included , by adding box-sizing:border-box
The sum of width and height properties include the padding and border, but not the margin will be 100px
http://jsfiddle.net/wizztjh/gn3Cw/6/
more information of box-sizing
Upvotes: 2
Reputation: 21882
Text fields have built in borders. Look what happens when you remove borders : Fiddle here
Upvotes: 1