Kali ni Tutorial Animate Buttons . Ada 3 jenis animate buttons ni.
Animated Buttons Yang Pertama- "Pressed Effect"
<style type="text/css">
.zatibutton {
padding: 15px 25px;
font-size: 24px;
text-align: center;
cursor: pointer;
outline: none;
color: #666;
background-color: #E4DFD8;
border: none;
border-radius: 15px;
box-shadow: 0 9px #999;
}
.zatibutton:hover {
background-color: #F6EFEA;
}
.zatibutton:active {
background-color: #CCCCCA;
box-shadow: 0 5px #666;
transform: translateY(4px);
}
</style>
<h2>
Animated Buttons Yang Pertama- "Pressed Effect"</h2>
<button class="zatibutton">Click Me</button>
Animated Button Yang Kedua
Code button ni :
<style type="text/css">
.zatiebutton {
border-radius: 4px;
background-color: #ff9696;
border: none;
color: #FFFFFF;
text-align: center;
font-size: 28px;
padding: 20px;
width: 200px;
transition: all 0.5s;
cursor: pointer;
margin: 5px;
}
.zatiebutton span {
cursor: pointer;
display: inline-block;
position: relative;
transition: 0.5s;
}
.zatiebutton span:after {
content: '\00bb';
position: absolute;
opacity: 0;
top: 0;
right: -20px;
transition: 0.5s;
}
.zatiebutton:hover span {
padding-right: 25px;
}
.zatiebutton:hover span:after {
opacity: 1;
right: 0;
}
</style>
<h2>Animated Button Yang Kedua</h2>
<button class="zatiebutton"><span>Hover </span></button>
Animated Button Yang Ketiga- Ripple Effect
Code button ni :
<style type="text/css">
.ztbutton {
position: relative;
background-color: #D3D5FF;
border: none;
font-size: 28px;
color: #666;
padding: 20px;
width: 200px;
text-align: center;
-webkit-transition-duration: 0.4s; /* Safari */
transition-duration: 0.4s;
text-decoration: none;
overflow: hidden;
cursor: pointer;
}
.ztbutton:after {
content: "";
background: #fff27f;
display: block;
position: absolute;
padding-top: 300%;
padding-left: 350%;
margin-left: -20px!important;
margin-top: -120%;
opacity: 0;
transition: all 0.8s
}
.ztbutton:active:after {
padding: 0;
margin: 0;
opacity: 1;
transition: 0s
}
</style>
<h2>Animated Button Yang Ketiga- Ripple Effect</h2>
<button class="ztbutton">Click Me</button>
Cara copy code ni, macam biasa, Layout > HTML/Javascript . Dan korang boleh ubah color , font size , size button mengikut citarasa korang!
0 Comments
Terima kasih sudi baca artikel ini. Sila berikan komen anda. Jemput follow blog ini ye!