Adding an asterisk to required fields in Bootstrap

This is pretty useful in giving a visual indication to the user when a form field is required.

The CSS:

.form-group.required .control-label:after {

Then in your HTML:

  <div class="form-group required">
    <label class="control-label">Required Field</label>

There will now be a nice little “*” after the label for “Required Field”.

3 thoughts on “Adding an asterisk to required fields in Bootstrap”

Leave a Reply

Your email address will not be published. Required fields are marked *