Advertisement
Home Open Editor ❯

HTML <input> width Attribute

Example

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

Try this code ❯

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"/>


Advertisement

Attribute Values

Value Description Example
pixels The width in pixels. <input width="100">
Home Open Editor ❯
Advertisement