HTML<输入>大小属性不起作用? [英] HTML <input> size attribute not working?

查看:91
本文介绍了HTML<输入>大小属性不起作用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有以下元素指定size =15。然而,具有尺寸属性的渲染元素的宽度可以容纳25个字符,如果maxlength较大,则可以容纳30个左右的宽度。 Maxlength确实限制了字符数。

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


推荐答案

这可能取决于您使用的字体,你正在测试什么字符!

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

这篇关于HTML&lt;输入&gt;大小属性不起作用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆