Edit This Code:
<!DOCTYPE html>
<html>
<title>W3.CSS</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="../lib/w3.css">
<body>

<form action="form.asp" class="w3-container">

<h2>Validating Labels</h2>
<p>Validating labels are red, and turns green when the input becomes valid. To make labels validating, add a w3-validate class to your w3-label class.</p>

<p>      
<input class="w3-input" type="text" name="first" required>
<label class="w3-label w3-validate">First Name</label></p>

<p>      
<input class="w3-input" type="text" name="last" required>
<label class="w3-label w3-validate">Last Name</label></p>

<p>      
<input class="w3-input" type="email" name="email" required>
<label class="w3-label w3-validate">Email</label></p>

<p>      
<button class="w3-btn w3-teal">Register</button></p>

</form>

</body>
</html>


Result:
Try it Yourself - © w3schools.com
Privacy Policy