Bootstrap3 - Using glyphicon as background image in CSS
2015-12-02 21:58
681 查看
示例一:
.expandable {height:40px;width:50%;margin:6px;}.expandable:before{content:"\2b";font-family:"Glyphicons Halflings";line-height:1;margin:5px;}.expanded {height:40px;width:50%;margin:6px;}.expanded:before{content:"\2212";font-family:"Glyphicons Halflings";line-height:1;margin:5px;}And for reference, my HTML is:
<div class="panel-group" id="accordion"><div class="panel panel-default"><div class="panel-heading"><p1 class="panel-title" ><a data-toggle="collapse" data-parent="#accordion" href="#collapseOne" class="expandable">Provider details</a><p2></div><div id="collapseOne" class="panel-collapse collapse"><div class="panel-body">blah, blah....And JS to detect the opening/closing of the sections:
$ ->$(".expandable").click () ->$this = $(this)if $this.hasClass("expandable")$this.removeClass("expandable").addClass "expanded"else $this.removeClass("expanded").addClass "expandable" if $this.hasClass("expanded")returnreturn示例二:
<div id="lol"></div>
#lol{height:40px;border:1px solid #555;width:50%;margin:30px;}#lol:before{content:"\2b";font-family:"Glyphicons Halflings";line-height:1;margin:10px;display:inline-block;}
相关文章推荐
- bootstrap快速链接
- 解决bootstrap中轮播插件支持手机上的手势滑动的问题
- Bootstrap_排版
- debootstrap 配置
- Bootstrap的Modal源码学习
- 让IE6 IE7 IE8 IE9 IE10 IE11支持Bootstrap的解决方法
- Bootstrap导航条navbar
- bootstrap中的媒体对象
- bootstrap中的媒体对象
- Java全新高大尚HTML5 bootstrap后台框架
- Bootstrap框架分分钟解决响应式导航(直接上代码)
- bootstrap快速入门笔记(九)-响应式工具
- bootstrap快速入门笔记(八)-按钮,响应式图片
- bootstrap快速入门笔记(七)-表格,表单
- Bootstrap v2.3.2 动态绑定折叠
- Bootstrap 附加导航(Affix)插件
- bootstrap学习网址
- bootstrap常见类的总结
- BootstrapOffCanves
- bootstrap快速入门笔记(六)-代码