基于bootstrap的单选(radio)或者多选(checkbox)的选择框组
完成的效果如下图所示:

html代码如下:
<!-- 两行组 -->
<div class="box">
<ul class="list-group">
<li class="input-group">
<span class="input-group-addon">
<input type="checkbox"></span>
<input type="text" class="form-control">
</li>
<li class="input-group">
<span class="input-group-addon">
<input type="checkbox"></span>
<input type="text" class="form-control">
</li>
</ul>
</div>
<!-- 三行组 -->
<div class="box">
<ul class="list-group">
<li class="input-group">
<span class="input-group-addon">
<input type="checkbox"></span>
<input type="text" class="form-control">
</li>
<li class="input-group">
<span class="input-group-addon">
<input type="checkbox"></span>
<input type="text" class="form-control">
</li>
<li class="input-group">
<span class="input-group-addon">
<input type="checkbox"></span>
<input type="text" class="form-control">
</li>
</ul>
</div>
<!-- 四行组 -->
<div class="box">
<ul class="list-group">
<li class="input-group">
<span class="input-group-addon">
<input type="checkbox"></span>
<input type="text" class="form-control">
</li>
<li class="input-group">
<span class="input-group-addon">
<input type="checkbox"></span>
<input type="text" class="form-control">
</li>
<li class="input-group">
<span class="input-group-addon">
<input type="checkbox"></span>
<input type="text" class="form-control">
</li>
<li class="input-group">
<span class="input-group-addon">
<input type="checkbox"></span>
<input type="text" class="form-control">
</li>
</ul>
</div>
css样式的代码如下:
@charset "UTF-8";
/*复选框输入框组css样式*/
.list-group .first .input-group-addon{
border-bottom:;
border-bottom-left-radius:;
}
.list-group .first .form-control{
border-bottom:;
border-bottom-right-radius:;
}
.list-group .last .input-group-addon{
border-top-left-radius:;
}
.list-group .last .form-control{
border-top-right-radius:;
}
.list-group .middle .input-group-addon{
border-bottom:;
border-top-left-radius:;
border-bottom-left-radius:;
}
.list-group .middle .form-control{
border-bottom:;
border-bottom-right-radius:;
border-top-right-radius:;
}
js的代码如下:
// 复选框输入框组js代码
$(function(){
var obj = $('ul.list-group');
obj.each(function(){
var li_obj = $(this).find('li');
var len = li_obj.length;
if (len>1) {
li_obj.first().addClass('first');
li_obj.last().addClass('last');
if(len>2){
var loop_len = len-2;
for (var i = 0; i < loop_len; i++) {
li_obj.eq(1+i).addClass('middle');
}
}
}
});
});
基于bootstrap的单选(radio)或者多选(checkbox)的选择框组的更多相关文章
- 利用CSS 修改input=radio的默认样式(改成选择框)
html部分: <input id="item2" type="radio" name="item"> <label fo ...
- bootstrap 列表 表格 表单 复选 单选 多选 输入框组
一.列表 ul li 二.表格 table (http://www.runoob.com/bootstrap/bootstrap-tables.html) 1. 基本表格 <table cla ...
- [原创]纯JS实现网页中多选复选框checkbox和单选radio的美化效果
图片素材: 最终效果图: <html><title> 纯JS实现网页中多选复选框checkbox和单选radio的美化效果</title><head>& ...
- 用jquery修改默认的单选框radio或者复选框checkbox选择框样式
默认的radio和checkbox选框很难看.我去看了一下qq注册的页面.发现单选和复选框并没有用<input>,居然是用是A标签.然后用css背景图片展示选择框,用JavaScript控 ...
- 【JavaScript&jQuery】单选框radio,复选框checkbox,下拉选择框select
HTML: <!DOCTYPE html> <html> <head> <title></title> <meta charset=& ...
- 基于Bootstrap的超酷jQuery开关按钮插件
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJgAAAA2CAIAAAC0tsfoAAAB/0lEQVR4nO3bQWrCQBTGcc/mbVz0DD
- 基于 Bootstrap 的扁平化 UI 开发包
Flat UI是一款基于Bootstrap的扁平化前端UI工具包,Flat UI的组件外观设计非常清新和漂亮,Flat UI的组件包含按钮,输入框,组合按钮,复选框,单选按钮,标签,菜单,进度条和滑块 ...
- 【转】基于Bootstrap的超酷jQuery开关按钮插件
基于Bootstrap的超酷jQuery开关按钮插件
- 基于Bootstrap仿淘宝分页控件实现
.header { cursor: pointer } p { margin: 3px 6px } th { background: lightblue; width: 20% } table { t ...
随机推荐
- UML-6.1-用例-示例
1.总览要点:用例.摘要.非正式.详述.测试用例.用例分析与迭代联系起来. 2.示例:Process Sale 1).客户携带所购商品到达收银台. 2).收银员使用pos系统记录每件商品. 操作契约: ...
- linux gpasswd
gpasswd命令 功能:管理组用法:gpasswd[-a user][-d user][-A user,...][-M user,...][-r][-R]groupname参数:-a:添加用户到组- ...
- Python - 三级菜单优化方法 (单层循环)
menu = {...... } current_layer = menu layers = [] while True: for k in current_layer: print(k) choic ...
- java NIO学前准备
之前一直对NIO感兴趣,无奈对IO的很多概念很模糊,所以对于NIO的学习也是一直半解,最近在网上查阅了很多资料,发现有很多概念是需要反复理解的,有的时候甚至当时理解了,但一段时间后又忘记了,所以决定自 ...
- oracle dump的使用心得
使用DS开发的时候,有的时候会遇到一个问题:数据库层面定义的空格与DS自已定义的空格概念不一致,导致生成的数据会有一定的问题. 举例来说: 在数据库里面定义CHAR(20),如果插入的字符不足20的时 ...
- Servlet用户登录功能实现
需求:完成用户登录页面校验 第一步:创建一个用户登录的html页面 <!DOCTYPE html> <html> <head> <meta charset=& ...
- 使用ant宏定义任务
基础basic.xml文件 <?xml version="1.0" encoding="UTF-8"?><project> < ...
- BAT的关于程序员的那些事
前言 你是否早有进入BAT公司的想法,但却因为对其不了解而在门外彷徨? 你是否想把技术团队打造成像BAT这些超级互联网公司,但却无从下手? 你是否已经进入了BAT,但是不知道如何晋升而苦恼? 那这篇文 ...
- Win7 开机启动
1.注册表里面写代码,设置程序以开机启动; 但这样会需要管理员权限,添加程序以管理员权限启动后,又无法直接进入到软件启动界面,UAC控制 代码一: /// <summary> /// 设置 ...
- 《Maven实战》关联实际工作的核心知识
通读了<Maven实战>这本书,由于在实际的工作中,对其有一定的操作上的经验.因此,再回头去通读这本书,就能够更加精准的把握里面的核心知识了. 以下我主要从两点去介绍之—— 1> m ...