How to add icon to input in bootstrap

angryTom
Release: 2019-07-20 13:25:17
Original
5282 people have browsed it

How to add icon to input in bootstrap

Recommended tutorial: Bootstrap tutorial

##Sample code

<div class="input-group">
    <div class="input-icon-group">
        <input type="text" class="form-control fc-clear" /> 
        <span id="scan" data-role="md" class="md md-center-focus-weak fa-lg input-icon input-icon-md" style="display: inline;"> 
        </span>
    </div>
    <span class="input-group-btn">
        <button class="btn btn-primary" type="button">
            批号        </button>
    </span>
</div>
Copy after login

Rendering:

How to add icon to input in bootstrap

Interpretation:

1. First, make them One line mainly contains the "

input-group", "input-icon-group" and "input-group-btn" attributes that work

 2. The effect of making the icons in the input appear in the input is mainly "

input-icon input-icon-md" and "display: inline".

 3. For the input box to occupy the entire line of space, instead of having a small width, "

form-control" works.

 4. After entering text in the input box, the icon will not be covered. What works is "

fc-clear".

The above is the detailed content of How to add icon to input in bootstrap. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!