Styling the hint on a HTML5 input field using required attribute

后端 未结 4 792
庸人自扰
庸人自扰 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:28

    I found a way to disable the hints from showing.

    Basically I found they're within a div element, in my reset if I add this to the top.

    div { display: none; }
    body div { display: block; }
    

    Then the hints no longer appear, yet the rest of my divs work fine.

    I'm also led to believe that the hints appear outside of the HTML document tag. As styling with html div also has no effect on the hints. Interesting stuff.

    This only works in Chrome though.

提交回复
热议问题