I want to create a form where the label is only displayed when the input element is on hover.
I've been following the right code on HTML 5 and CSS3 to do that but it's still not working and wondering why ?
Can you show me where my mistakes are ?
On HTML5:
<section class="container">
<form>
<div class="row">
<div class="col1">
<label>What is your full name ?</label>
</div>
<div class="username">
<input type="text" name="name" placeholder="First name">
<input type="text" name="name" placeholder="Last name">
</div>
</div>
</form>
</section>
On CSS3:
.col1{
display: none;
}
.username input:hover .col1{
display: block;
}
With this code, the element stays hidden when input on hover. How to make it display?