Adding asterisk to required fields in Bootstrap 3

前端 未结 7 584
粉色の甜心
粉色の甜心 2021-01-29 17:56

My HTML has a class called .required that is assigned to required fields.

Here is the HTML:

相关标签:
7条回答
  • 2021-01-29 18:22

    I modified the css, as i am using bootstrap 3.3.6

    .form-group.required label:after{   
    color: #d00;   
    font-family: 'FontAwesome'; 
    font-weight: normal;
    font-size: 10px;
    content: "\f069"; 
    top:4px;   
    position: absolute;   
     margin-left: 8px;
    }
    

    the HTML

    <div class="form-group required">
     <label for="return_notes"><?= _lang('notes') ?></label>
     <textarea class="form-control" name="return_notes" id="return_notes"  required="required"></textarea>
    </div>
    
    0 讨论(0)
提交回复
热议问题