基于css3实现漂亮便签样式


Posted in HTML / CSS onMarch 18, 2013

效果图如下:
基于css3实现漂亮便签样式
代码如下:

复制代码
代码如下:

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Live Preview</title>
<style>
body {
background: #f5f5f5;
font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
font-size: 12px;
padding: 50px 0 10px 0;
}
.custom {
width: 260px;
margin: 0 auto;
}
.tags {
padding: 0;
}
.tags a {
background-image: -moz-linear-gradient(top, rgba(255,255,255,0.12) 0%, rgba(0,0,0,0.1) 99%, rgba(0,0,0,0.1) 100%);
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(255,255,255,0.12)), color-stop(99%,rgba(0,0,0,0.1)), color-stop(100%,rgba(0,0,0,0.1)));
background-image: -webkit-linear-gradient(top, rgba(255,255,255,0.12) 0%,rgba(0,0,0,0.1) 99%,rgba(0,0,0,0.1) 100%);
background-image: -o-linear-gradient(top, rgba(255,255,255,0.12) 0%,rgba(0,0,0,0.1) 99%,rgba(0,0,0,0.1) 100%);
background-image: -ms-linear-gradient(top, rgba(255,255,255,0.12) 0%,rgba(0,0,0,0.1) 99%,rgba(0,0,0,0.1) 100%);
background-image: linear-gradient(top, rgba(255,255,255,0.12) 0%,rgba(0,0,0,0.1) 99%,rgba(0,0,0,0.1) 100%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#1fffffff', endColorstr='#1a000000',GradientType=0 );
-webkit-border-top-right-radius: 3px;
-webkit-border-bottom-right-radius: 3px;
-moz-border-radius-topright: 3px;
-moz-border-radius-bottomright: 3px;
border-top-right-radius: 3px;
border-bottom-right-radius: 3px;
box-shadow: 0 1px 0 rgba(255,255,255,0.5) inset;
display: inline-block;
font-size: 12px;
font-weight: bold;
line-height: 25px;
height: 25px;
padding: 0 10px;
position: relative;
text-shadow: 0 1px 0 rgba(0,0,0,0.5);
text-decoration: none;
margin: 0 15px 5px 0;
border: 1px solid;
border-left: 0;
color: #fff;
}
.tags a:before {
background-image: -moz-linear-gradient(-45deg, rgba(255,255,255,0.12) 0%, rgba(0,0,0,0.1) 99%, rgba(0,0,0,0.1) 100%);
background-image: -webkit-gradient(linear, left top, right bottom, color-stop(0%,rgba(255,255,255,0.12)), color-stop(99%,rgba(0,0,0,0.1)), color-stop(100%,rgba(0,0,0,0.1)));
background-image: -webkit-linear-gradient(-45deg, rgba(255,255,255,0.12) 0%,rgba(0,0,0,0.1) 99%,rgba(0,0,0,0.1) 100%);
background-image: -o-linear-gradient(-45deg, rgba(255,255,255,0.12) 0%,rgba(0,0,0,0.1) 99%,rgba(0,0,0,0.1) 100%);
background-image: -ms-linear-gradient(-45deg, rgba(255,255,255,0.12) 0%,rgba(0,0,0,0.1) 99%,rgba(0,0,0,0.1) 100%);
background-image: linear-gradient(-45deg, rgba(255,255,255,0.12) 0%,rgba(0,0,0,0.1) 99%,rgba(0,0,0,0.1) 100%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#1fffffff', endColorstr='#1a000000',GradientType=1 );
-webkit-transform: rotate(45deg);
-moz-transform: rotate(45deg);
-ms-transform: rotate(45deg);
-o-transform: rotate(45deg);
transform: rotate(45deg);
filter: progid:DXImageTransform.Microsoft.Matrix(/* IE6–IE9 */ M11=0.7071067811865476, M12=-0.7071067811865475, M21=0.7071067811865475, M22=0.7071067811865476, sizingMethod='auto expand');
zoom: 1;
box-shadow: 1px 0px 0 rgba(255,255,255,0.5) inset;
content: '';
height: 18px;
left: -10px;
position: absolute;
top: 3px;
width: 18px;
z-index: -1;
border: 1px solid;
border-right: 0;
border-top: 0;
}
.tags a:after {
position: absolute;
background: #fff;
content: '';
width: 5px;
height: 5px;
left: 0;
border-radius: 5px;
top: 9px;
border: 1px solid #888;
}
.tags a:hover {
background-image: -moz-linear-gradient(top, rgba(255,255,255,0.25) 0%, rgba(0,0,0,0.1) 100%);
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(255,255,255,0.25)), color-stop(100%,rgba(0,0,0,0.1)));
background-image: -webkit-linear-gradient(top, rgba(255,255,255,0.25) 0%,rgba(0,0,0,0.1) 100%);
background-image: -o-linear-gradient(top, rgba(255,255,255,0.25) 0%,rgba(0,0,0,0.1) 100%);
background-image: -ms-linear-gradient(top, rgba(255,255,255,0.25) 0%,rgba(0,0,0,0.1) 100%);
background-image: linear-gradient(top, rgba(255,255,255,0.25) 0%,rgba(0,0,0,0.1) 100%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#40ffffff', endColorstr='#1a000000',GradientType=0 );
}
.tags a:hover:before {
background-image: -moz-linear-gradient(-45deg, rgba(255,255,255,0.25) 0%, rgba(0,0,0,0.1) 100%);
background-image: -webkit-gradient(linear, left top, right bottom, color-stop(0%,rgba(255,255,255,0.25)), color-stop(100%,rgba(0,0,0,0.1)));
background-image: -webkit-linear-gradient(-45deg, rgba(255,255,255,0.25) 0%,rgba(0,0,0,0.1) 100%);
background-image: -o-linear-gradient(-45deg, rgba(255,255,255,0.25) 0%,rgba(0,0,0,0.1) 100%);
background-image: -ms-linear-gradient(-45deg, rgba(255,255,255,0.25) 0%,rgba(0,0,0,0.1) 100%);
background-image: linear-gradient(-45deg, rgba(255,255,255,0.25) 0%,rgba(0,0,0,0.1) 100%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#40ffffff', endColorstr='#1a000000',GradientType=1 );
}
.tags a:active {
background-image: -moz-linear-gradient(top, rgba(0,0,0,0.14) 0%, rgba(255,255,255,0.12) 100%);
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(0,0,0,0.14)), color-stop(100%,rgba(255,255,255,0.12)));
background-image: -webkit-linear-gradient(top, rgba(0,0,0,0.14) 0%,rgba(255,255,255,0.12) 100%);
background-image: -o-linear-gradient(top, rgba(0,0,0,0.14) 0%,rgba(255,255,255,0.12) 100%);
background-image: -ms-linear-gradient(top, rgba(0,0,0,0.14) 0%,rgba(255,255,255,0.12) 100%);
background-image: linear-gradient(top, rgba(0,0,0,0.14) 0%,rgba(255,255,255,0.12) 100%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#24000000', endColorstr='#1fffffff',GradientType=0 );
}
.tags a:active:before {
background-image: -moz-linear-gradient(-45deg, rgba(0,0,0,0.14) 0%, rgba(255,255,255,0.12) 100%);
background-image: -webkit-gradient(linear, left top, right bottom, color-stop(0%,rgba(0,0,0,0.14)), color-stop(100%,rgba(255,255,255,0.12)));
background-image: -webkit-linear-gradient(-45deg, rgba(0,0,0,0.14) 0%,rgba(255,255,255,0.12) 100%);
background-image: -o-linear-gradient(-45deg, rgba(0,0,0,0.14) 0%,rgba(255,255,255,0.12) 100%);
background-image: -ms-linear-gradient(-45deg, rgba(0,0,0,0.14) 0%,rgba(255,255,255,0.12) 100%);
background-image: linear-gradient(-45deg, rgba(0,0,0,0.14) 0%,rgba(255,255,255,0.12) 100%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#24000000', endColorstr='#1fffffff',GradientType=1 );
}
.tags .inset {
color: rgba(0,0,0,0.5);
text-shadow: 0 1px 0 rgba(255,255,255,0.5);
}
/* === Customs ==========
================================================== */
.tags a, .tags a:before { background-color: #b7b7b7 }
.tags a, .tags a:after, .tags a:before { border-color: #777 }
.tags a.inset {
color: #454545; /* Here you can override the default rgba(0,0,0,0.5); */
}
.tags .tag-red, .tags .tag-red:before { background-color: #f25c48 }
.tags .tag-red, .tags .tag-red:after, .tags .tag-red:before { border-color: #bc4738 }
.tags .tag-red.inset { color: #8a241e }
.tags .tag-blue, .tags .tag-blue:before { background-color: #0b9db7 }
.tags .tag-blue, .tags .tag-blue:after, .tags .tag-blue:before { border-color: #087184 }
.tags .tag-blue.inset { color: #054854 }
.tags .tag-orange, .tags .tag-orange:before { background-color: #f28f1a }
.tags .tag-orange, .tags .tag-orange:after, .tags .tag-orange:before { border-color: #bb6e14 }
.tags .tag-orange.inset { color: #7e4a0d }
.tags .tag-green, .tags .tag-green:before { background-color: #00A600 }
.tags .tag-green, .tags .tag-green:after, .tags .tag-green:before { border-color: #007500 }
.tags .tag-brown, .tags .tag-brown:before { background-color: #AE8F00 }
.tags .tag-brown, .tags .tag-brown:after, .tags .tag-brown:before { border-color: #5B4B00 }
.tags .tag-gray, .tags .tag-gray:before { background-color: #5B5B5B }
.tags .tag-gray, .tags .tag-gray:after, .tags .tag-gray:before { border-color: #272727 }
.tags .tag-puple, .tags .tag-puple:before { background-color: #6F00D2 }
.tags .tag-puple, .tags .tag-puple:after, .tags .tag-puple:before { border-color: #3A006F }
.tags .tag-fen, .tags .tag-fen:before { background-color: #FF00FF }
.tags .tag-fen, .tags .tag-fen:after, .tags .tag-fen:before { border-color: #460046 }
.tags .tag-danlan, .tags .tag-danlan:before { background-color: #5CADAD }
.tags .tag-danlan, .tags .tag-danlan:after, .tags .tag-danlan:before { border-color: #3D7878 }
</style>
</head>
<body>
<div class="tags custom">
<a href="#">默认</a>

<a href="#" class="tag-blue">淡蓝色</a><a href="#" class="tag-blue inset">淡蓝色文字</a>

<a href="#" class="tag-orange">橘黄色</a><a href="#" class="tag-orange inset">橘黄色文字</a>

<a href="#" class="tag-red">暗红色</a><a href="#" class="tag-red inset">暗红色文字</a>

<a href="#" class="tag-green">绿色</a>

<a href="#" class="tag-brown">棕色</a>

<a href="#" class="tag-gray">灰色</a>

<a href="#" class="tag-puple">紫色</a>

<a href="#" class="tag-fen">粉色</a>

<a href="#" class="tag-danlan">淡蓝</a>
</div>​
</body>
</html>

HTML / CSS 相关文章推荐
使用JS+CSS3技术:让你的名字动起来
Apr 27 HTML / CSS
用CSS3写的模仿iPhone中的返回按钮
Apr 04 HTML / CSS
CSS3 仿微信聊天小气泡实例代码
Apr 05 HTML / CSS
用CSS3实现无限循环的无缝滚动的示例代码
Nov 01 HTML / CSS
css3 transform导致子元素固定定位变成绝对定位的方法
Mar 06 HTML / CSS
CSS3 input框的实现代码类似Google登录的动画效果
Aug 04 HTML / CSS
HTML5计时器小例子
Oct 15 HTML / CSS
HTML5 Canvas+JS控制电脑或手机上的摄像头实例
May 03 HTML / CSS
HTML5 在canvas中绘制矩形附效果图
Jun 23 HTML / CSS
video实现有声音自动播放的实现方法
May 20 HTML / CSS
AmazeUI的JS表单验证框架实战示例分享
Aug 21 HTML / CSS
CSS实现九宫格布局(自适应)的示例代码
Feb 12 HTML / CSS
css3 按钮 利用css3实现超酷下载按钮
Mar 18 #HTML / CSS
利用css3制作3D样式按钮实现代码
Mar 18 #HTML / CSS
css3 按钮样式简单可扩展创建
Mar 18 #HTML / CSS
css3气泡 css3关键帧动画创建的动态通知气泡
Feb 26 #HTML / CSS
css 省略号 css3让多余的字符串消失并附加省略号的实现代码
Feb 07 #HTML / CSS
7款设计巧妙的css3飘带状3D立体效果的导航菜单和表单窗口
Feb 04 #HTML / CSS
8款精美的CSS3表单设计(登录表单/下拉选择/按钮附演示及源码)
Feb 04 #HTML / CSS
You might like
php截取视频指定帧为图片
2016/05/16 PHP
验证坐标在某坐标区域内php代码
2016/10/08 PHP
Flash+XML滚动新闻代码 无图片 附源码下载
2007/11/22 Javascript
JavaScript中for-in遍历方式示例介绍
2014/02/11 Javascript
javascript实现可拖动变色并关闭层窗口实例
2015/05/15 Javascript
详解JavaScript的另类写法
2016/04/11 Javascript
jQuery链式调用与show知识浅析
2016/05/11 Javascript
Bootstrap基本插件学习笔记之模态对话框(16)
2016/12/08 Javascript
JavaScript初学者必看“new”
2017/06/12 Javascript
基于构造函数的五种继承方法小结
2017/07/27 Javascript
微信小程序 rich-text的使用方法
2017/08/04 Javascript
Thinkphp5微信小程序获取用户信息接口的实例详解
2017/09/26 Javascript
vue.js element-ui tree树形控件改iview的方法
2018/03/29 Javascript
Bootstrap-table使用footerFormatter做统计列功能
2018/09/07 Javascript
Vue中使用方法、计算属性或观察者的方法实例详解
2018/10/31 Javascript
使用 Element UI Table 的 slot-scope方法
2019/10/10 Javascript
vue+koa2搭建mock数据环境的详细教程
2020/05/18 Javascript
如何在selenium中使用js实现定位
2020/08/18 Javascript
整理Python最基本的操作字典的方法
2015/04/24 Python
Python 专题二 条件语句和循环语句的基础知识
2017/03/19 Python
Python随机生成手机号、数字的方法详解
2017/07/21 Python
pandas带有重复索引操作方法
2018/06/08 Python
Python切割图片成九宫格的示例代码
2020/03/10 Python
Python描述数据结构学习之哈夫曼树篇
2020/09/07 Python
python实现银行账户系统
2021/02/22 Python
CSS3之多背景background使用示例
2013/10/18 HTML / CSS
加利福尼亚州威尼斯的女性奢侈品设计师服装和概念店:Mona Moore
2018/09/13 全球购物
在校生自我鉴定
2014/01/23 职场文书
五年级数学教学反思
2014/02/11 职场文书
大学军训感言400字
2014/03/11 职场文书
2014年预备党员学习两会心得体会
2014/03/17 职场文书
产品推广策划方案
2014/05/10 职场文书
献爱心标语
2014/06/21 职场文书
高中生第一学年自我鉴定2015
2014/09/28 职场文书
2015年双拥工作总结
2015/04/08 职场文书
2015年卫生局工作总结
2015/07/24 职场文书