I've been attempting to change the color of required fields in a form to red, but so far I haven't had any success. Here is the form code and the CSS that I have experimented with.
contact.html
<h2>Send us an email...</h2>
<br/>
<ul>
<li>
<label for="senderName" >Your Name</label>
<input type="text" name="senderName" id="senderName" required="required" placeholder="Please type your name" maxlength="40" />
</li>
<li>
<label for="senderEmail" >Your Email Address</label>
<input type="email" name="senderEmail" id="senderEmail" required="required" placeholder="Please type your email address" maxlength="50" />
</li>
<li>
<label for="message" style="padding-top: .5em;" >Your Message</label>
<textarea name="message" id="message" placeholder="Please type your message" required="required" cols="80" rows="10" maxlength="10000"></textarea>
</li>
</ul>
<div id="formButtons">
<input type="submit" id="sendMessage" name="sendMessage" value="Send Email" />
<input type="button" id="cancel" name="cancel" value="Cancel" />
</div>
</form>
style.css
label[required=required]{
color: darkred;
}
label[] > input[required="required"] {
background: red; }