用css3实现各种图标效果
来源:互联网 发布:手机游戏录像软件 编辑:程序博客网 时间:2024/06/07 22:55
<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <title>Title</title> <style type="text/css"> [class^="u-icon"] { display: inline-block; color: #fff; vertical-align: middle; } .u-icon-sel { position: relative; -webkit-box-sizing: border-box; width: 32%; height: 32px; line-height: 30px; margin-bottom: 4px; border: 1px solid #a4afc6; border-radius: 3px; color: #a4afc6; text-align: center; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; } .u-icon-sel.on { overflow: hidden; border-color: #ff5d1d; color: #000; } .u-icon-sel.on:before { position: absolute; right: 0; bottom: 0; width: 18px; height: 18px; background: url(http://webresource.c-ctrip.com/ResCorpMobile/R1/img/common-graphic37.png?20150423) no-repeat -23px -152px/150px 240px; content: ''; } .u-icon-sel.more { color: #6daeee; } .u-icon-deleteToggle { width: 75px; height: 45px; line-height: 45px; text-align: center; } .u-icon-deleteToggle.Blue { background-color: #3e74b9; } .u-icon-deleteToggle.Orange { background-color: #ff5d1d; } /*白色垃圾桶、灰色垃圾桶图标*/ .u-icon-trash,.u-icon-grayTrash { background: url(http://webresource.c-ctrip.com/ResCorpMobile/R1/img/common-graphic37.png?20150423) no-repeat 0 0/150px 240px; } .u-icon-trash { background-position: 0 -84px; width: 16px; height: 18px; } .u-icon-grayTrash { display: inline-block; width: 12px; height: 18px; margin-right: 8px; vertical-align: -2px; background-position: -3px -178px; } /*不用任何图标实现删除icon效果*/ .u-icon-delete { position: absolute; bottom: 5px; right: 0; width: 40px; height: 40px; } /*给before伪类设置一个默认背景色 设置content*/ .u-icon-delete:before { position: absolute; top: 10px; left: 10px; width: 20px; height: 20px; border-radius: 20px; background-color: #8e8e93; content: ''; } /*给after伪类 -webkit-transform: rotate(-45deg);旋转 background-color: #e1e2e4;设置X的一边的颜色*/ .u-icon-delete:after { position: absolute; top: 19px; left: 14px; width: 12px; height: 2px; -webkit-transform: rotate(-45deg); background-color: #e1e2e4; content: ''; } /* -webkit-transform: rotate(45deg); 运用的特别巧秒*/ .u-icon-delete i { position: absolute; top: 19px; left: 14px; width: 12px; height: 2px; background-color: #e1e2e4; -webkit-transform: rotate(45deg); } /*橙色背景中间一白色横杠的删除icon */ .u-icon-del { position: relative; width: 24px; height: 24px; border: 1px solid #ff5d1d; -webkit-border-radius: 24px; border-radius: 24px; -webkit-transition: 300ms ease-in-out; transition: 300ms ease-in-out; background-color: #ff5d1d; } .u-icon-del.on,.on .u-icon-del { -webkit-transform: rotateZ(90deg); } /*这里的background-color: #fff;和 content: "\20";实现白色横杠*/ .u-icon-del::after { position: absolute; top: 10px; left: 4px; width: 16px; height: 4px; background-color: #fff; content: "\20"; } .u-icon-radioDelete { position: relative; width: 24px; height: 24px; border: 1px solid #8AADD8; -webkit-border-radius: 24px; border-radius: 24px; -webkit-transition: 300ms ease-in-out; transition: 300ms ease-in-out; } .u-icon-radioDelete::after { position: absolute; top: 11px; left: 4px; width: 16px; height: 2px; background-color: #8AADD8; color: #8AADD8; content: "\20"; } .u-icon-radioDelete.on,.on .u-icon-radioDelete { -webkit-transform: rotateZ(90deg); -ms-transform: rotateZ(90deg); } </style></head><body><span class="u-icon-radioDelete"></span><span class="u-icon-deleteToggle Orange"> <span class="u-icon-trash"></span>删除</span><span class="u-icon-deleteToggle Blue"> <span class="u-icon-grayTrash"></span>删除</span><span class="u-icon-del"></span><span class="u-icon-del on"></span><span class='u-icon-sel more'>搜索更多</span><span class='u-icon-sel on'>搜索更多</span><span class='u-icon-delete'><i></i></span></body></html>
0 0
- 用css3实现各种图标效果
- 用css3实现各种图标效果
- CSS3实现各种格子纹理效果
- 纯CSS3图标旋转效果
- css3 shadow实现的各种漂亮阴影效果
- CSS3 实现RSS图标
- css3绘制各种图形效果
- css3绘制各种图形效果
- 用CSS3实现发光的边框效果
- 可以用css3实现风车效果
- 用css3实现简单的进入效果
- CSS3用transition实现边框动画效果
- CSS3-用过渡实现气泡效果
- css3实现闪光效果
- css3实现按钮开关效果
- CSS3实现折纸效果
- css3实现手风琴效果
- css3实现冲击波效果
- 剑指offer——面试题30:最小的k个数
- SpringMVC源码分析(二)-URL映射的注册
- 教程之ucgui_向按钮发送一个按键消息的程序追踪
- 计算N天之后的日期函数
- 图解几个与Linux网络虚拟化相关的虚拟网卡-VETH/MACVLAN/MACVTAP/IPVLAN
- 用css3实现各种图标效果
- [Hive]Hive安装
- MongoDB NOSQL数据库常见的面试题汇总
- pwd命令
- IIS配置
- kryo序列化-默认bufferSize
- Angular2(六)--单一实例(singleton)示例
- MAC+VirtualBox Work环境记录
- Angular2(七)--Hierarchical dependence injection