The W3C validator says: "Attribute size not allowed on element input at this point."
<input type="file" name="foo" size="40" />
What is the correct way to specify the width of a file input in HTML5?
In your css file, specify the width as such:
input[type=file] { width: 300px; border: 2px solid red; }
http://jsfiddle.net/VbTAV/
In the input field use the style attribute, this allow you to use css.
<input type="file" name="foo" style="width: 40px" />
Or with separate css:
input[name="foo"] {
width: 40px;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With