Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Size doesn't work with HTML5 Input tag

Tags:

html

For below code, the size value is ignored. Any help is appreciated?

<p><input type="submit" name="login" id="login" value="Login" size="125"/> </p>
like image 377
codematrix Avatar asked Dec 07 '22 15:12

codematrix


1 Answers

it's for text, password or file input field

The size attribute is used to set the width of a text, password or file input field. The length of these fields is determined by the number of characters that should be visible

For all other input types, the size refers to the width of the control in pixels. Given the presentational nature of this attribute, it’s usually best avoided. Instead, use CSS to define field widths using more precise measurements, with the exception of a file input where CSS control over the input’s appearance is severely limited (for very valid security reasons) and the size attribute is your only real option.

like image 88
Joseph Avatar answered Jan 09 '23 19:01

Joseph