如何设置HTML5的默认验证通知,该通知在" required"属性被使用。我想更改通知位置并将其显示在输入字段旁边
答案 0 :(得分:0)
试试这个:
<style type="text/css">
input:required:invalid, input:focus:invalid {
background-image: url(/images/invalid.png); //set image
background-position: right top;
background-repeat: no-repeat;
}
input:required:valid {
background-image: url(/images/valid.png);
background-position: right top;
background-repeat: no-repeat;
}
</style>