I have a form, with a label and input type=text. I am using the pattern="" to validate the text and am displaying a message under the text input when the validation fails. I want to be able to change the color of the label as well as the text inside the text input, but cant seem to get it going. This is what I have so far. I do not want to use js.
<div class="form-group address">
<label for="address" class="form-group__names" id="invalid">Address</label>
<input type="text" name="address" pattern="^\d+\s[A-z]+\s[A-z]+,\s+[A-z]+,\s+[A-z]
{2}\s+\d{5}" />
<b></b>
</div>
.form-group input:invalid + b:before {
content: "Form is invalid";
color: red;
}
input[type="text"]:invalid + label#invalid {
color: red;
}