I'm trying to create a form that only uses inputs/textarea w/ border-bottom, but when left empty when using required in my syntax it gives an ugly red border around all four sides of the inputs/textarea.
input, textarea {
background-color: inherit;
border: 0;
border-bottom: 2px solid $primary-color;
color: #fff;
font-size: 1.2em;
line-height: 2.5;
margin-right: 25px;
width: 25%;
}
input:last-child {
margin-right: 0;
margin-left: 25px;
}
input::placeholder, textarea::placeholder {
color: #fff;
}
textarea {
font-family: $font-family-sans-serif;
margin: 30px 25px;
resize: none;
width: 55%;
}
<input type="text" name="name" placeholder="Full Name" required>
<input type="email" name="email" placeholder="E-Mail" required>
<textarea name="message" cols"30" rows="5" placeholder="Message" required></textarea>
I've tried selectors like :empty / :invalid / :required Empty doesn't seem to work. Invalid doesn't seem to work. I realized required selects all required fields and does that styling so, obviously that won't work.
What CSS selector am I looking for?
Example of what I'm referring to: Red Box, What selector to target