Styling the hint on a HTML5 input field using required attribute

后端 未结 4 695
庸人自扰
庸人自扰 2021-02-01 23:32

Is it possible to style the hint that appears on a HTML5 input field when using the required attribute. If you\'re not sure what I\'m talking about click submit on this form wit

4条回答
  •  春和景丽
    2021-02-02 00:12

    you can style the validation bubble in webkit using the following pseudo-selectors:

    ::-webkit-validation-bubble
    ::-webkit-validation-bubble-top-outer-arrow
    ::-webkit-validation-bubble-top-inner-arrow
    ::-webkit-validation-bubble-message
    

    For Mozilla browsers there isn't a way yet. Mozilla does support x-moz-errormessage if you want to change the text: https://developer.mozilla.org/en/HTML/element/input#section_5

提交回复
热议问题