JSFiddle - React, Tailwind, and code Playground
HTML
<input type="text" id="email" />
<label for="email">Confirm Email</label>
<input type="text" id="firstname" />
<label for="firstname">First Name</label>
<input type="text" id="lastname" />
<label for="lastname">Last Name</label>
<input type="text" id="company" />
<label for="company">Company</label>
CSS
input:hover + label {
background-color: #eee;
}
input {
position: relative;
display: block;
margin-top: 1.5em;
}
label {
display: block;
position: relative;
top: -2.5em;
}