Default input element size

后端 未结 3 1152
醉酒成梦
醉酒成梦 2020-12-18 23:42

The input element by default is size=\"20\" if this is not defined inline or a CSS style rule is attributed to it.

How do you make the default the actual size of the

3条回答
  •  暖寄归人
    2020-12-19 00:14

    "How do you make the default the actual size of the value? (...) I would really just like it if I could put: input { width: auto; } Anyway to do this?"

    In an Input HTML Element, width is controlled by its size attribute. This is a quick way I use to simulate { width: auto; }, and it is browsers dependance proof:

    
    

提交回复
热议问题