input checkbox / radio 大变样
来源:互联网 发布:互联网电影数据库 编辑:程序博客网 时间:2024/05/17 08:53
实际应用中,我们很少使用原生的input框,大家都嫌他丑…也因此诞生了很多美化input的插件。工作中,设计师根据不同系统设计的input框可谓各式各样,以最近做的一个项目为例,不借助插件,input + label就能轻松搞定。
<span class="has-checkbox"> <input type="checkbox" id="checkAll" value="0" onclick="onCheckAll(this)"> <label for="checkAll">全选</label></span>
// 敲黑板 划重点啦 伪类选择器:checked//label样式.has-checkbox label { position:relative;}.has-checkbox label::before { content: ''; position: absolute; top: 12px; left: 15px; width: 18px; height: 18px; background: url(../../images/icons/checkbox.png) no-repeat center / 18px;}.has-checkbox > input:checked + label::before { background: url(../../images/icons/checkbox-checked.png) no-repeat center / 18px;}
// input框 第一种实现方式 把input弄到天涯海角 .has-checkbox > input { position: absolute; left: -2222px;}// input框 第二种实现方式 把input 隐藏.has-checkbox > input { visibility:hidden;}
效果展示:
题外话:
曾几何 单纯善良的我以为 下面的方法是可以的,然而!Android 上没问题,iPhone上却有了黑框…..
// 这个方法在iPhone 上有bug!!!PC端倒是没问题.has-checkbox > input { -webkit-appearance: none; -moz-appearance: none; -o-appearance: none; outline: none; border:0;}
效果展示:
阅读全文
0 0
- input checkbox / radio 大变样
- input checkbox radio样式改变
- jquery select input:radio input:checkbox
- js操作input控件【radio、checkbox】
- input中的radio和checkbox美化
- html中input(radio,checkbox)取消/选中
- css input checkbox和radio样式美化
- 三年大变样之目标
- CSS定义Input之Radio和Checkbox的样式
- JQuery中 input areatext select checkbox radio 取值方法
- CSS定义Input之Radio和Checkbox的样式
- input标签、radio标签、checkbox标签、select标签
- jquery过滤选择常用radio,select,checkbox,input 等标签
- jQuery 根据ID,获取input/checkbox/radio/select
- jQuery 操作 html 元素的例子 (input/select/checkbox/radio)
- jquery操作input、select、checkbox、radio常用方法
- jquery 控制 select radio checkbox input 不可修改
- input的checkbox和radio控件样式美化
- Java NIO系列教程(六) Selector
- map的增删改查说明
- redisLock redis分布式锁
- Python脚本练习-登录
- JAXP学习(2)简单示例
- input checkbox / radio 大变样
- java访问远程文件判断是否存在的问题
- Java NIO系列教程(七) FileChannel
- 写给Android开发者的混淆使用手册
- Yii2 学习之在modules中添加验证码方法详解
- Android R文件介绍
- 读书笔记-《Spring技术内幕》-计文柯(三):Spring MVC与We
- Android系统源码编译之2---安装CURL
- 泛型