HTML <input> width Attribute

❮ HTML <input> tag

Example

<input type="image" src="submit.jpg" alt="Submit" width="50" height="50">

Meaning

The width attribute is used to size an input element particularly when images are used as in <input type="image">.

CSS properties are preferred.

Always specify both the height and width attributes for images.


Standard Syntax

HTML: <input width="pixels">

XHTML: <input width="pixels"/>



Browser Support




Status







Attribute Values

Value Description Example
pixels The width in pixels. <input width="100">
❮ HTML <input> tag