博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
设计一个精致按钮
阅读量:7175 次
发布时间:2019-06-29

本文共 2477 字,大约阅读时间需要 8 分钟。

<!DOCTYPE html>

<html>
<head>
<meta charset="UTF-8">
<title></title>
</head>
<style type="text/css">
body{background: #ededed;
color: #999;
margin: 32px auto;
}
.button{ /*定义渐进按钮的样式*/
display: inline-block;
/*zoom与display属性都为了兼容IE7,使其具有
disply:inlineblock特性*/
zoom: 1;
*display: inline;
vertical-align: baseline;
margin: 0 2px;
outline: none;
cursor: pointer;
text-align: center;
text-decoration: none;
font: 14px/100% arial,sans-serif,helvetica;
padding: .5em 2em .55em;
/*设计按钮圆角和阴影特效*/
text-shadow: 0 1px 1px rgba(0, 0, 0, .3);
-webkit-border-radius: .5em;
-moz-border-radius: .5em;
border-radius: .5em;
-webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, .2);
-moz-box-shadow:0 1px 2px rgba(0, 0, 0, .2);
box-shadow: 0 1px 2px rgba(0, 0, 0, .2);
}
.button:hover{
text-decoration: none;
}
.button:active{
position: relative;
top: 1px;
}
.bigrounded{
/*定义大圆角类样式*/
-webkit-border-radius: 2em;
-moz-borser-radius:2em;
border-radius: 2em;
}
.medium{
/*定义中等按钮样式*/
font-size: 12px;
padding: .4em 1.5em .42em;
}
.small{
/*定义小按钮*/
font-size: 11px;
padding: .2em 1em .275em;
}
/*设计颜色样式类:黑色按钮
通过不同的颜色样式类,可以设计不同的按钮风格*/
.black { /* 黑色样式类 */
color: #d7d7d7;
border: solid 1px #333;
background: #333;
background: -webkit-gradient(linear, left top, left bottom, from(#666), to(#000));
background: -moz-linear-gradient(top, #666, #000);
background: linear-gradient(to bottom, #666, #000);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#666666', endColorstr='#000000');
}
.black:hover { /* 黑色鼠标经过样式类 */
background: #000;
background: -webkit-gradient(linear, left top, left bottom, from(#444), to(#000));
background: -moz-linear-gradient(top, #444, #000);
background: linear-gradient(to bottom, #444, #000);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#444444', endColorstr='#000000');
}
.black:active { /* 黑色鼠标激活样式类 */
color: #666;
background: -webkit-gradient(linear, left top, left bottom, from(#000), to(#444));
background: -moz-linear-gradient(top, #000, #444);
background: linear-gradient(to bottom, #000, #444);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#000000', endColorstr='#666666');
}
</style>
<body>
<div>
<a href="#" class="button black">圆角按钮</a>
<a href="#" class="button black bigrounded">大号椭圆按钮</a>
<a href="#" class="button black medium">中号按钮</a>
<a href="#" class="button black small">小号按钮</a> <br />
</div>
</body>
</html>

 您可以打开连接查看: http://runjs.cn/detail/b0muxozn

转载于:https://www.cnblogs.com/wxhhts/p/8570469.html

你可能感兴趣的文章
面向对象程序设计
查看>>
非主从同步 mysql master slave pt-slave-delay
查看>>
【思科×××】IPsec ×××基本部署
查看>>
检验新买内存条的真假
查看>>
解密:华为的敏捷网络是SDN吗
查看>>
u16 u32 __u16 __u32 u_int16_t u_int32_t
查看>>
android: BaseAdapter和ListView简单运用(08)
查看>>
自带内存上的读写(openFileOutput和openFileInput)
查看>>
服务器搭建:3.2、openresty图片压缩之 lua调用GraphicsMagick
查看>>
bash 脚本编程 变量、变量类型 (笔记)
查看>>
win7 管理员权限
查看>>
docker下redis集群搭建
查看>>
composer出现proc_open,fileinfo问题
查看>>
无ROWID优化(The WITHOUT ROWID Optimization)
查看>>
Android第七课 探索Activity的生命周期
查看>>
求排列
查看>>
Cisco-CCNP之OSPF链路状态路由协议(三)
查看>>
CentOS 7 系列(一)系统服务 systemd
查看>>
Hive 数据倾斜总结
查看>>
mysql查询结果处理
查看>>