<form action="">
<input required type="text">
<button type="submit">submit</button>
</form>
<style>
input:user-invalid { background-color: red; }
</style>
<form action="">
<input required type="text">
<button type="submit">submit</button>
</form>
<style>
input:user-invalid { background-color: red; }
</style>