开发者

Can you make a <input type="text"> element have a size shorter than 1?

I have an <input> that I want to be smaller than size="1" but I do not know how to make it smaller. Is it possible to do this?

I tried using fractions and de开发者_Go百科cimals but neither worked.


You can assign it a pixel width instead:

<input type="text" style="width: 4px">


For type="text", no. At least, not using the size attribute:

The width is given in pixels except when type attribute has the value "text" or "password". In that case, its value refers to the (integer) number of characters.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜