Default input element size

后端 未结 3 1153
醉酒成梦
醉酒成梦 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:17

    The input element by default is size="20"

    This "default size" depends on the browser, the version and your OS. It is not possible to do this in inline styles.

    the best solution is to set width and padding so it adds up to 100%

    input {
      width: 98%;
      padding: 1%;
    }
    

    then set it to absolute left and right 0

    finally add this css

    
    

提交回复
热议问题