How to make input label with a red star ?


Topic: How to make input label with a red star ?

wuohyeah pro premium priority asked 5 months ago

enter image description here

How to make input label with a red * to indicate a required field? Please you show me a snippet. Thank you.


Bartosz Cylwik staff answered 5 months ago

You can play around with the label pseudoclass. Add padding-right to the form-label class and create a form-label::after with * as a content

.form-label::after {
    ...
    content: "*";
    color: red;
    ...
}

Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Answered

Specification of the issue
  • User: Pro
  • Premium support: Yes
  • Technology: MDB Vue
  • MDB Version: MDB5 5.0.0
  • Device: Desktop
  • Browser: Chrome
  • OS: Linux
  • Provided sample code: No
  • Provided link: No
Tags