您好,登錄后才能下訂單哦!
這是使用CSS3制作的一個圓形按鈕。效果看起來很簡單,其實制作也非常的簡單的,主要就是徑向漸變的運用,以及@font-face實現的ICON效果,當然其中也離開不其他屬性的點綴效果,比如說box-shadow制作的陰影,transition制作的動畫效果等。
代碼中所需要的fonts我已經以附件的形式上傳了,下載下來,fonts目錄和代碼頁面 平級,這樣就沒有問題了。不要放錯位置哦
<!DOCTYPE HTML>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<title>精美的圓形按鈕效果</title>
<style>
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;
}
</style>
</head>
<body>
<div class="page">
<div class="buttons">
<button type="button" class="button">twitter</button>
<button type="button" class="button">github</button>
</div>
</section>
<section id="ad_w3cplus">
<div class="grid-ad">
<script type="text/javascript">
/*250*250,*/
var cpro_id = "u1089145";
</script>
<script src="http://cpro.baidustatic.com/cpro/ui/c.js" type="text/javascript"></script>
</div>
<div class="grid-ad">
<script type="text/javascript">
/*250*250,*/
var cpro_id = "u1089141";
</script>
<script src="http://cpro.baidustatic.com/cpro/ui/c.js" type="text/javascript"></script>
</div>
<div class="grid-ad">
<script type="text/javascript">
/*250*250,*/
var cpro_id = "u1086065";
</script>
<script src="http://cpro.baidustatic.com/cpro/ui/c.js" type="text/javascript"></script>
</div>
<p><script type="text/javascript">
var _bdhmProtocol = (("https:" == document.location.protocol) ? " https://" : " http://");
document.write(unescape("%3Cscript src='" + _bdhmProtocol + "#/h.js%3F177319b798978621f83845b12c86fa29' type='text/javascript'%3E%3C/script%3E"));
</script>
</p>
</section>
</div>
</body>
</html>
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。