基于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 相关文章推荐
纯CSS3实现质感细腻丝滑按钮
Mar 09 HTML / CSS
css3实现蒙版弹幕功能
Jun 18 HTML / CSS
html5 Canvas画图教程(10)—把面拆成线条模拟出圆角矩形
Jan 09 HTML / CSS
html5 viewport使用方法示例详解
Dec 02 HTML / CSS
html5各种页面切换效果和模态对话框用法总结
Dec 15 HTML / CSS
HTML5 Canvas绘制五星红旗
May 04 HTML / CSS
使用phonegap查找联系人的实现方法
Mar 31 HTML / CSS
HTML5 textarea高度自适应的两种方案
Apr 08 HTML / CSS
css3实现背景图片颜色修改的多种方式
Apr 13 HTML / CSS
详解CSS开发过程中的20个快速提升技巧
May 21 HTML / CSS
HTML5页面打开微信小程序功能实现
Sep 23 HTML / CSS
html用代码制作虚线框怎么做? dw制作虚线圆圈的技巧
Dec 24 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类
2006/11/27 PHP
PHP读取ACCESS数据到MYSQL的代码
2011/05/11 PHP
php打造属于自己的MVC框架
2012/03/07 PHP
浅谈PHP强制类型转换,慎用!
2013/06/06 PHP
javascript利用初始化数据装配模版的实现代码
2010/11/17 Javascript
javascript学习笔记(十一) 正则表达式介绍
2012/06/20 Javascript
通过javascript获取iframe里的值示例代码
2013/06/24 Javascript
JavaScript自执行闭包的小例子
2013/06/29 Javascript
javascript禁用键盘功能键让右击及其他键无效
2013/10/09 Javascript
深入理解JavaScript系列(27):设计模式之建造者模式详解
2015/03/03 Javascript
BootStrap制作导航条实例代码
2016/05/06 Javascript
用纯Node.JS弹出Windows系统消息提示框实例(MessageBox)
2017/05/17 Javascript
jquery Form轻松实现文件上传
2017/05/24 jQuery
深入浅出webpack之externals的使用
2017/12/04 Javascript
浅谈js闭包理解
2019/04/01 Javascript
用云开发Cloudbase实现小程序多图片内容安全监测的代码详解
2020/06/07 Javascript
解决vue项目运行提示Warnings while compiling.警告的问题
2020/09/18 Javascript
Vue实现购物车基本功能
2020/11/08 Javascript
[52:37]完美世界DOTA2联赛循环赛 Forest vs DM BO2第一场 10.29
2020/10/29 DOTA
python的numpy模块安装不成功简单解决方法总结
2017/12/23 Python
Pandas读取MySQL数据到DataFrame的方法
2018/07/25 Python
详解Python3网络爬虫(二):利用urllib.urlopen向有道翻译发送数据获得翻译结果
2019/05/07 Python
python 上下文管理器及自定义原理解析
2019/11/19 Python
Tensorflow tensor 数学运算和逻辑运算方式
2020/06/30 Python
python爬虫泛滥的解决方法详解
2020/11/25 Python
纯css3实现的竖形无限级导航
2014/12/10 HTML / CSS
利用CSS3 动画 绘画 圆形动态时钟
2018/03/20 HTML / CSS
HTML5 解决苹果手机不能自动播放音乐问题
2017/12/27 HTML / CSS
网络艺术零售业的先驱者:artrepublic
2017/09/26 全球购物
亚洲最大的运动鞋寄售店:KicksCrew
2020/11/26 全球购物
Hibernate持久层技术
2013/12/16 面试题
医学生实习自荐信
2013/10/01 职场文书
医学院毕业生自荐信范文
2014/03/06 职场文书
发票退票证明
2015/06/24 职场文书
Python关于OS文件目录处理的实例分享
2021/05/23 Python
CI Games宣布《堕落之王2》使用虚幻引擎5制作 预计将于2023年正式发售
2022/04/11 其他游戏