开发者

How to create a Textbox with style that accepts only 2 characters

How do i create a html textbox which looks that it can accepts only 2开发者_运维知识库 characters .

<input type="text"  maxlength="2" size="1"/>

what style do i need to apply so that textbox can be shown in such way it can accept 2 characters style ="???"


A simple width would do:

<input type="text"  maxlength="2" size="1" class="twochar"/>

And the css:

.twochar
{
    width:2em;
}

http://jsfiddle.net/kjl_42/vstMC/

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜