本文摘自PHP中文网,作者angryTom,侵删。

推荐教程:Bootstrap教程
示例代码
1 2 3 4 5 6 7 8 9 10 11 | < 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 >
|
效果图:

解读:
1、首先使得他们在一行主要是"input-group
"、“input-icon-group
”和“input-group-btn
”属性起作用
2、使得input里面的图标在input里面展现的效果主要是“input-icon input-icon-md
”起作用,和“display: inline
”起作用。
3、对于input框能够占据整行空隙,而不是宽度很小,起作用的是“form-control
”。
4、对于input框里面输入文字后,不会覆盖图标,起作用的是“fc-clear
”。
以上就是bootstrap怎么给input加图标的详细内容,更多文章请关注木庄网络博客!
相关阅读 >>
bootstrap是框架吗
bootstrap4.5栅格系统的任意列问题怎么解决?
bootstrap字体图标怎么引用
bootstrap 基础教程之表单部分实例代码
bootstrap-select下拉框如何清除选中的状态?
easyui和bootstrap的区别
常用input文本框内容自动垂直居中并默认提示文字单击为空
bootstrap.css样式表是什么
bootstrap heading是什么意思
bootstrap是不是js库
更多相关阅读请进入《bootstrap》频道 >>
人民邮电出版社
本书对 Vue.js 3 技术细节的分析非常可靠,对于需要深入理解 Vue.js 3 的用户会有很大的帮助。——尤雨溪,Vue.js作者
转载请注明出处:木庄网络博客 » bootstrap怎么给input加图标