HTML | <input> width Attribute Last Updated : 12 May, 2021 Comments Improve Suggest changes Like Article Like Report The HTML <input> width Attribute is used to specify the width of the <input> element. This Attribute is only used for input type="image". Syntax: <input width="pixels"> Attribute Values: It contains the value i.e pixels which specify the width of the input Element. Example: HTML <!DOCTYPE html> <html> <body style="text-align:center;"> <h1 style="color:green;"> GeeksForGeeks </h1> <h2>HTML Input width Attribute</h2> <input id="myImage" type="image" src= "https://media.geeksforgeeks.org/wp-content/uploads/gfg-40.png" alt="Submit" width="48" height="48" /> </body> </html> Output: Supported Browsers: Google Chrome 1.0Firefox 16.0EdgeOpera 1.0Apple Safari Comment More infoAdvertise with us Next Article HTML | <input> width Attribute M manaschhabra2 Follow Improve Article Tags : Web Technologies HTML HTML-Attributes Similar Reads HTML <input> align Attribute The HTML <input> align attribute is used with <input type=â imageâ> to set the horizontal alignment of the image. It is not supported by HTML 5. Note: Since <input type=â imageâ> is not supported by HTML5 you can use CSS there instead of this attribute. The syntax for CSS <input 1 min read HTML input maxlength Attribute The maxlength attribute in the HTML <input> element is used to define the maximum number of characters that can be entered into the field. If no value is specified, or if an invalid value is provided, the input field will have no maximum length. The length is determined in UTF-16 code units, w 2 min read HTML | <input> name Attribute The HTML <input> name Attribute is used to specify a name for an <input> element. It is used to reference the form-data after submitting the form or to reference the element in a JavaScript. Syntax: <input name="name"> Attribute Values: It contains a single value name which describ 1 min read HTML | <input> list Attribute The HTML <input> list Attribute is used to identify a list of pre-defined options for an element to suggest the user. Syntax: <input list="datalist_id"> Attribute Values: datalist_id: It is used to specify the Id of the datalist that will used to make a link up with the input element. Ex 1 min read HTML | <input> required Attribute The HTML required Attribute is a Boolean attribute which is used to specify that the input element must be filled out before submitting the Form. This attribute works with other types of input like radio, checkbox, number, text, etc.Syntax: <input required> Example-1: This Example that illustr 1 min read HTML <input> disabled Attribute The disabled attribute for <input> element in HTML is used to specify that the input field is disabled. A disabled input is un-clickable and unusable. It is a boolean attribute. The disabled <input> elements are not submitted in the form. Syntax: <input disabled> Example: html < 1 min read HTML <input> type Attribute The HTML <input> type Attribute is used to specify the type of <input> element to display. The default type of <input> type attribute is text. Syntax: <input type="value">Attribute Values: Name Description button Defines clickable button in HTML document, commonly activated w 3 min read HTML input autofocus Attribute The autofocus attribute in HTML is used to specify that a particular form element (like an input field, textarea, or select dropdown) should automatically receive focus when the page is loaded, allowing the user to start interacting with it immediately without needing to click on it.Syntax<input 1 min read HTML | input readonly Attribute The readonly attribute of <input> element in HTML is used to specify that the input field is read-only. If an input is readonly, then it's content cannot be changed but can be copied and highlighted. It is a boolean attribute. Syntax: <input readonly> Example: This example uses HTML < 1 min read HTML < input> accept Attribute The HTML <input> accept attribute is used to control the type of files that can be selected for input, restricting the file selection to specific formats such as image/* for images or .pdf for PDF files. Syntax: <input accept = "file_extension | audio/* | video/* | image/* | media_type"> 4 min read Like