Submitted over 1 year ago
Frontend Mentor - Base Apparel coming soon page
@aratinau
Design comparison
SolutionDesign
Solution retrospective
I used the pseudo css class :invalid
to display the email error message
<div class="form-group"> <input type="email" placeholder="Email Address"/> <button type="submit" class="btn"> <img src="images/icon-arrow.svg"/> </button> <span class="error-message">Please provide a valid email</span> </div>
.error-message {
visibility: hidden;
font-weight: 300;
margin-left: 1rem;
margin-top: 1rem;
color: hsl(var(--soft-red));
}
input:invalid ~ .error-message {
visibility: visible;
}
Community feedback
Please log in to post a comment
Log in with GitHubJoin our Discord community
Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!
Join our Discord