Currently, I am in the process of creating a contact form for a website that is inspired by the design of Google's material sign-in form.
I have successfully implemented an effect where clicking on the input field causes the label to change its position, size, and color. However, this effect only works with input fields that have the "required" attribute.
Unfortunately, I have not been able to achieve the same effect with default input fields.
The CSS code for this form can be found below:
.civildaily-form {
display: block;
}
.civildaily-form .form-group {
position: relative;
margin-bottom: 2rem;
}
/* More CSS code */
Here is an example of how the form markup looks like:
<form class="civildaily-form">
<div class="form-group">
<input type="text" class="form-control" required>
<label for="Name">Name</label>
</div>
/* Additional form inputs */
</form>