Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save techxdeveloper/28cba270667b93e89f441bc9b081697d to your computer and use it in GitHub Desktop.
Save techxdeveloper/28cba270667b93e89f441bc9b081697d to your computer and use it in GitHub Desktop.
CSS Psuedo Class Selector (:valid and :invalid)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>CSS Psuedo Class Selector (:valid and :invalid)</title>
<style>
h1 {
color: #00bdc4;
border-bottom: 1px solid #bdbdbd;
padding-bottom: 20px;
}
input:valid {
background-color: #00bcd4;
color: #f5f5f5;
}
input:invalid {
background-color: #f44336;
color: #f5f5f5;
}
</style>
</head>
<body>
<div>
<h1>CSS Psuedo Class Selector (:valid and :invalid)</h1>
<form action="">
Email Address: <input type="email"><br>
</form>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment