HTML Guides for size
Learn how to identify and fix common HTML validation errors flagged by the W3C Validator — so your pages are standards-compliant and render correctly across every browser. Also check our Accessibility Guides.
The size attribute of an <input> takes digits only, and a value like 32/ usually means a self-closing slash got glued onto an unquoted value, as in <input size=32/>.
size sets the visible width of a text field in characters, and the HTML standard requires a valid non-negative integer greater than zero: one or more digits with nothing else around them. The character after "saw" in the message is the first one that isn't a digit. A / points to the slash problem, p to a CSS unit as in 32px, and a blank to a stray space inside the quotes.
An unquoted attribute value runs until the next space or >, so in <input size=32/> the slash becomes part of the value. The trailing slash on a void element like <input> does nothing in HTML anyway. Remove it, or quote the value (size="32") so the slash stays outside it. For widths in pixels or other units, set them with the CSS width property instead of size.
Invalid example
<label for="q">Search</label>
<input type=text id=q name=q size=32/>
Valid example
<label for="q">Search</label>
<input type="text" id="q" name="q" size="32">
The size attribute on an <input> element must be a whole number greater than zero, so size="0" is invalid.
size sets the visible width of a text field, counted in characters. It applies to the text, search, url, tel, email and password input types. The HTML standard requires a valid non-negative integer greater than zero, and browsers ignore a zero value and render the field at their default width of about 20 characters. Any value that parses to zero, such as 0 or 00, produces this error.
Templates and CMS search modules often write size="0" to mean "no fixed width" and leave the sizing to CSS. The attribute has no such meaning, so the zero only adds an error to the page.
Remove the attribute when CSS sets the width of the field, or set it to the number of characters that should be visible, such as size="30". The size attribute does not limit how much text the user can type; maxlength does that.
Invalid example
<form action="/search">
<label for="q">Search</label>
<input type="text" id="q" name="q" size="0">
</form>
Valid example
<form action="/search">
<label for="q">Search</label>
<input type="text" id="q" name="q" size="30">
</form>
Validate at scale.
Ship accessible websites, faster.
Automated HTML & accessibility validation for large sites. Check thousands of pages against WCAG guidelines and W3C standards in minutes, not days.
1K Weekly
1,000 monthly checks. Cancel anytime.
Get 1K Weekly →Join teams across 40+ countries