IE/FF/Chrome之间的文本框宽度不同-文本框填充'W'时会引起问题 [英] Text-box width different between IE / FF / Chrome - Causing issues when textbox is filled with 'W's

查看:24
本文介绍了IE/FF/Chrome之间的文本框宽度不同-文本框填充'W'时会引起问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个应用程序,该应用程序的文本字段具有指定的长度-4.

We have an application that has a text field with a specified length - 4.

Chrome浏览器:Firefox:

Chrome: Firefox:

有没有一种方法可以迫使Firefox/IE使用固定宽度间距?对于ID号,这是一个问题,其中字段实际上接受完整的输入,但是默认情况下不显示完整宽度(如果他们从屏幕上键入字段而不是复制/粘贴,则可能导致用户错误).

Is there a way force Firefox / IE to use fixed-width spacing? This is an issue in the case of ID numbers, where the field is actually accepting the full input, but by default not displaying the full width (potentially causing user error if they are typing the field from the screen rather than copy/pasting).

推荐答案

而不是尝试将 size 属性更改为5.因此,在所有浏览器中,它都适合.

Instead try changing size attribute to 5. So in all browsers, it will fit.

<input size="5" maxlength="4" value="WWWW" id="txt">

这篇关于IE/FF/Chrome之间的文本框宽度不同-文本框填充'W'时会引起问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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