HTML <input> size attribute not working?

html, input

Solution

It probably depends on the font you are using, and what character you are testing with!

Problem

I have the following element which specifies the size="15". However the rendered element, which has the size attribute, has a width that fits 25 characters and could fit 30 or so if maxlength was greater? Maxlength does limit the # of characters. ``` <input id="txtSearch" name="txtSearch" type="text" maxlength="25" size="15" /> ```

Original source