<input type=“submit”> padding bug on Safari mobile?

前端 未结 5 2080
眼角桃花
眼角桃花 2021-02-13 23:47

(This is similar to the (also unanswered) question #3430506, but applies to input tags instead of HTML5 elements.)

On buttons, th

5条回答
  •  清歌不尽
    2021-02-14 00:20

    If you try setting the padding to an enormous value, say 100px, you'll notice that the top and bottom padding grow, while again left and right stays at the default value, in mobile Safari. So I suppose it's safe to assume that this quite simple counts as a bug in the webkit routines of iOS, and there is no direct solution unless Apple fixes the problem.

    A workaround would be to create a DIV that looks like whatever you want it to, and add an onclick handler that submits your form. No need to ever use a real submit button.

提交回复
热议问题