基于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 ...
随机推荐
- Map.Entry使用详解
1.Map.Entry说明 Map是java中的接口,Map.Entry是Map的一个内部接口. Map提供了一些常用方法,如keySet().entrySet()等方法,keySet()方法返回值是 ...
- SpringCloud---服务容错保护---Spring Cloud Hystrix
1.概述 1.1 在分布式架构中,存在着许多的服务单元,若一个单元出现故障,很容易因依赖关系引发故障的蔓延,最终导致整个系统的瘫痪: 为了解决这样的问题,产生了断路器等服务保护机制: 1.2 分布式架 ...
- (转)Systemd 入门教程:命令篇
Systemd 入门教程:命令篇 原文:http://www.ruanyifeng.com/blog/2016/03/systemd-tutorial-commands.html Systemd 入门 ...
- Python调用C++DLL函数出错String类型问题
调用c++ 函数原型如下,一直失败,请个日志断点发现 参数未能正确解析. int EXPORT init_ner(string cfg_path); typedef int (*Proc_init_n ...
- Class and Instance Variables In Ruby
https://github.com/unixc3t/mydoc/blob/master/blog/caiv.md
- [Git & GitHub] 利用Git Bash进行第一次提交文件
转载:https://blog.csdn.net/dietime1943/article/details/72420042 利用Git Bash进行第一次提交文件 快下班的时候,MD群里有人问怎么向g ...
- [转]微信小程序填坑之路之使用localhost在本地测试
本文转自:http://www.wxappclub.com/topic/798
- Navicat 大小写
1.找到数据库表的存在位置 比如我的是C:\ProgramData\MySQL\MySQL Server 5.7\Data\tinysdpm 2.修改小写的表名称 比如customer_type.fr ...
- WPF binding<一> Data Binding在WPF中的地位
在代码中看到 <Image Source="{Binding ElementName=LBoxImages, Path=SelectedItem.Source}" /> ...
- T-SQL 备份和还原数据库
--完整备份 Backup Database db_database To disk='D:\Backup\db_database_Full.bak' --差异备份 Backup ...