display: block not expanding input to fill parent's width
How do I get the input to expand to the full width of the parent div? For label it worked fine. The code can be found here: http://jsfiddle.net/7h8Zg开发者_如何学编程/
What makes the label expand but not the input?
change the left padding to percent, and use the rest for width, like so:
padding:0 0 0 2%;width:98%;
If you want the inputs to be the same size as the submit
button, you should add width:97%
to the input
rule.
http://jsfiddle.net/7h8Zg/15/
Adding
width: 100%;
to the input class allows the input to expand to the full size of the parent div.
JSFiddle: http://jsfiddle.net/7h8Zg/5/
精彩评论