I'm using css to highlight a textbox with red border when it is required
.garbage[style*=inline] + input,
.garbage[style*=inline] + select,
.garbage[style*=inline] + textarea {
background-color: #ffcccc;
border: 1px solid #ff0000;
}
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" ControlToValidate="Txt_fullname" runat="server" ErrorMessage="RequiredFieldValidator" class="garbage" SetFocusOnError="true" ValidationGroup="submit" Display="Dynamic">Type this field please.</asp:RequiredFieldValidator>
<asp:TextBox ID="Txt_fullname" runat="server" ></asp:TextBox>
<asp:Button ID="Btn_submit" runat="server" Text="submit form" CausesValidation="true" ValidationGroup="submit"
onclick="Btn_submit_Click" />
the problem is the css not apply until I click on the textbox