.contact-form input:required { /*  , textarea:required  */
    background: #fff url(../images/asterisk.png) no-repeat 98%; /* no-repeat 98% center */
}

.contact-form textarea:required {
    background: #fff url(../images/asterisk.png) no-repeat 98%; /* no-repeat 98% center */
}

.contact-form input:focus:invalid { /*  , .contact-form textarea:focus:invalid when a field is considered invalid by the browser */
    background: #fff url(../images/invalid.png) no-repeat 98%; /* center */
    box-shadow: 0 0 5px #d45252;
    border-color: #b03535
}
.contact-form textarea:focus:invalid {
    background: #fff url(../images/invalid.png) no-repeat 98%; /* center */
    box-shadow: 0 0 5px #d45252;
    border-color: #b03535
}