html中的圆形图片按钮代码,使用CSS3制作的一个圆形精美按钮代码

5268f80b9b1e01f982625ef6fac83ca1.png

这是使用CSS3制作的一个圆形按钮。效果看起来很简单,其实制作也非常的简单的,主要就是径向渐变的运用,以及@font-face实现的ICON效果,当然其中也离开不其他属性的点缀效果,比如说box-shadow制作的阴影,transition制作的动画效果等。

代码中所需要的fonts我已经以附件的形式上传了,下载下来,fonts目录和代码页面 平级,这样就没有问题了。不要放错位置哦

精美的圆形按钮效果

body {

margin-top:100px;

padding-left:100px;

}

.demo {

width: 400px;

text-align: center;

margin:80px auto 0;

}

.button {

cursor:pointer;

position: relative;

font-size: 0;

width: 100px;

height: 100px;

text-align: center;

margin-right: 50px;

border-radius: 50%;

border:none;

box-shadow: 0 2px 5px rgba(0,0,0,.4);

background: -webkit-linear-gradient(top,#fff,#d5dbe1);

background: -moz-linear-gradient(top,#fff,#d5dbe1);

background: -ms-linear-gradient(top,#fff,#d5dbe1);

background: -o-linear-gradient(top,#fff,#d5dbe1);

linear-gradient(top,#fff,#d5dbe1);

-webkit-transition: all .13s ease-out;

-moz-transition: all .13s ease-out;

-o-transition: all .13s ease-out;

transition: all .13s ease-out;

}

.button:after {

display: inline-block;

font-family: 'icomoon';

font-size: 24px;

color: #bdc0c1;

content: attr(data-icon);

speak: none;

font-weight: normal;

-webkit-font-smoothing: antialiased;

width: 64px;

line-height: 64px;

margin: 10px;

border-radius: 32px;

border: 1px solid #efefef;

box-shadow: -1px 0 0 #dbdcdd,1px 0 0 #dbdcdd,0 1px 0 #d0d1d2,0 0 8px #fff;

background: -webkit-linear-gradient(top left,#fcfcfc 50%,#dfe4e8);

}

.button:first-child:after {

content: "\21";

}

.button:last-child:after {

content: "\25";

}

.button:hover:after {

color: #19a6e4;

box-shadow: 0 1px 3px #d7d8d9 inset;

background: -webkit-radial-gradient(#dbeef8 ,#f2f4f6 50%);

}

.button:active {

top: 3px;

box-shadow: 0 1px 3px #d7d8d9 inset;

}

@font-face {

font-family: 'icomoon';

url('fonts /icomoon.eot');

url('fonts /icomoon.eot?#iefix') format('embedded-opentype'),

url('fonts/icomoon.svg#icomoon') format('svg'),

url('fonts/icomoon.woff') format('woff'),

url('fonts/icomoon.ttf') format('truetype');

font-weight: normal;

font-style: normal;

}

twitter

github

/*250*250,*/

var cpro_id = "u1089145";

/*250*250,*/

var cpro_id = "u1089141";

/*250*250,*/

var cpro_id = "u1086065";

var _bdhmProtocol = (("https:" == document.location.protocol) ? " https://" : " http://");

document.write(unescape("%3Cscript src=\'#\'" + _bdhmProtocol + "hm.baidu.com/h.js%3F177319b798978621f83845b12c86fa29' type='text/javascript'%3E%3C/script%3E"));

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值