Styling Required Fields in Web Forms
Use a CSS style rule to control how required fields display in a public-facing Web form. The basic style rule is the following, or any compliant variation:
.formWidgetRequired { border: 2px inset red; }
There are three distinct methods for applying style to form elements. You can use any of these methods to define a unique style for required form fields:
- To add the "required" style to a Body Content style sheet
- To add the "required" style to a .css file (global style sheet)
- To apply the "required" style in-line
It is recommended that you use the method consistent with how style is already being applied to content in your Web site.
Note: There may be a five to 10 minute delay before an added style (using any method) displays on live pages. You can clear the browser cache or try a different method.