<!DOCTYPE html>
<html lang="en-US">
<head>
<style>
input:valid{
background-color: green;
color: #fff;
}
</style>
</head>
<body>
<h1>CSS :valid Selector</h1>
<input type="email" value="blabla">
<input type="email" value="joe@gmail.com">
</body>
</html>