Wednesday, November 3, 2021

HTML - How to make a different color for blank textbox

<style>
  .validated:invalid {
    background: #FAC3C9;
  }

  .validated:valid {
    background: #BDF0A8;
   }
</style>

<form action="action.php">
  <input required name="name1" class="validated" type="text" />
</form>

No comments:

Post a Comment