...
/Solution: Custom Email Input with Inline Validation Icons
Solution: Custom Email Input with Inline Validation Icons
Let’s create a styled email input that shows a check or cross icon for valid or invalid states using only CSS and relational selectors.
We'll cover the following...
We'll cover the following...
Problem description
Given an HTML page containing a <div class="input-wrapper"> that wraps an <input type="email" id="email" class="validation-input" placeholder="Enter your email" required>, write CSS to:
Define CSS variables on
.input-wrapper:--valid-color,--invalid-color, and--transition-duration.Style
.validation-inputin the following manner:Width should be
100%, padding-right should be2rem(space for icon), padding-left should be0.5rem, and height should be2rem.Border should be
1px solid #ccc,border-radiusshould be4px.Transition on ...