开发者

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

开发者 https://www.devze.com 2023-01-22 03:43 出处:网络
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 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

精彩评论

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