Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Integrate custom png image on input group addon

I have this output using input-group-add-on:

enter image description here

Let say if I want to use my own icon

My expected output will be like this:

enter image description here

Icons: [enter image description here3 [enter image description here]4 [enter image description here]5

Can anyone help me?

My codes:

                       <div class="input-group" style="margin-top:4px;">
                            <span class="input-group-addon">
                                <span class="glyphicon glyphicon-lock"></span>
                            </span>
                            <input type="text" class="form-control" placeholder="<?= lang('education.year') ?> *" />
                        </div>
                        <div style="margin-top:4px;">
                            <div style="float:left; width:49%;">
                                <div class="input-group">
                                    <span class="input-group-addon">
                                        <span class="glyphicon glyphicon-user"></span>
                                    </span>
                                    <select name="gender" class="form-control">
                                        <option value=""><?= lang('gender') ?> *</option>
                                    </select>
                                </div>
                            </div>
                            <div style="float:right; width:49%;">
                                <div class="input-group">
                                    <span class="input-group-addon">
                                        <span class="glyphicon glyphicon-lock"></span>
                                    </span>
                                    <select class="form-control">
                                        <option value=""><?= lang('preferred.language') ?> *</option>
                                        <option value="<?= PREFERRED_LANGUAGE_MALAY ?>">Bahasa Malaysia</option>
                                        <option value="<?= PREFERRED_LANGUAGE_ENGLISH ?>">English</option>
                                    </select>
                                </div>
                            </div>
                        </div>
like image 938
Nere Avatar asked Jan 07 '23 00:01

Nere


1 Answers

Well, you just have to replace the glyphicon span with an <img src="...">:

<div class="input-group">
    <span class="input-group-addon">
        <img src="path/to/img.png">
    </span>
    <input type="text" class="form-control" placeholder="<?= lang('education.year') ?> *" />
</div>
like image 110
scandel Avatar answered Jan 14 '23 12:01

scandel