<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<style>
input:valid {
background: #E4F6DE;
}
input:invalid {
background: #FFEBEB;
}
</style>
</head>
<body>
<input required="" />
<input required="" />
</body>
</html>