CÁC BƯỚC THỰC HIỆN
Bước 1: Truy cập vào Blogger.com - Chủ đề - Chỉnh sửa HTML.
Bước 2: Thêm toàn bộ CSS dưới vào trên thẻ
</b:skin>
.@import url(https://fonts.googleapis.com/css?family=Squada+One);Bước 3: Lưu Template lại.
body {background: #344557 url(https://unsplash.imgix.net/photo-1423683249427-8ca22bd873e0?fit=crop&fm=jpg&h=700&q=75&w=1050) 0 0 no-repeat;background-size: cover;}
body:after {content: '';background: rgba(52, 69, 87, 0.85);}
a {display: block;width: 220px;height: 70px;z-index: 1;}
a:after {content: '';background: linear-gradient(120deg, #6559ae, #ff7159, #6559ae);background-size: 400% 400%;-webkit-clip-path: polygon(0% 100%, 4px 100%, 4px 4px, 216px 4px, 216px 66px, 4px 66px, 4px 100%, 100% 100%, 100% 0%, 0% 0%);-moz-animation: gradient 3s ease-in-out infinite, border 1s forwards ease-in-out reverse;-webkit-animation: gradient 3s ease-in-out infinite, border 1s forwards ease-in-out reverse;animation: gradient 3s ease-in-out infinite,border 1s forwards ease-in-out reverse;}
a > span {
display: block;
background: linear-gradient(120deg, #6559ae, #ff7159, #6559ae);
background-size: 400% 400%;
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
-moz-animation: gradient 3s ease-in-out infinite;
-webkit-animation: gradient 3s ease-in-out infinite;
animation: gradient 3s ease-in-out infinite;
}
/* helpers */
.absolute-centering, body:after, a, a:after {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
margin: auto;
}
.text-formatting, a {
text-transform: uppercase;
text-decoration: none;
text-align: center;
letter-spacing: 2px;
line-height: 70px;
font-family: 'Squada One', cursive;
font-size: 28px;
}
/* motion */
@-moz-keyframes gradient {
0% {
background-position: 14% 0%;
}
50% {
background-position: 87% 100%;
}
100% {
background-position: 14% 0%;
}
}
@-webkit-keyframes gradient {
0% {
background-position: 14% 0%;
}
50% {
background-position: 87% 100%;
}
100% {
background-position: 14% 0%;
}
}
@keyframes gradient {
0% {
background-position: 14% 0%;
}
50% {
background-position: 87% 100%;
}
100% {
background-position: 14% 0%;
}
}
@-moz-keyframes border {
0% {
-webkit-clip-path: polygon(0% 100%, 4px 100%, 4px 4px, 216px 4px, 216px 66px, 4px 66px, 4px 100%, 100% 100%, 100% 0%, 0% 0%);
}
25% {
-webkit-clip-path: polygon(0% 100%, 4px 100%, 4px 4px, 216px 4px, 216px 66px, 216px 66px, 216px 100%, 100% 100%, 100% 0%, 0% 0%);
}
50% {
-webkit-clip-path: polygon(0% 100%, 4px 100%, 4px 4px, 216px 4px, 216px 4px, 216px 4px, 216px 4px, 216px 4px, 100% 0%, 0% 0%);
}
75% {
-webkit-clip-path: polygon(0% 100%, 4px 100%, 4px 4px, 4px 4px, 4px 4px, 4px 4px, 4px 4px, 4px 4px, 4px 0%, 0% 0%);
}
100% {
-webkit-clip-path: polygon(0% 100%, 4px 100%, 4px 100%, 4px 100%, 4px 100%, 4px 100%, 4px 100%, 4px 100%, 4px 100%, 0% 100%);
}
}
@-webkit-keyframes border {
0% {
-webkit-clip-path: polygon(0% 100%, 4px 100%, 4px 4px, 216px 4px, 216px 66px, 4px 66px, 4px 100%, 100% 100%, 100% 0%, 0% 0%);
}
25% {
-webkit-clip-path: polygon(0% 100%, 4px 100%, 4px 4px, 216px 4px, 216px 66px, 216px 66px, 216px 100%, 100% 100%, 100% 0%, 0% 0%);
}
50% {
-webkit-clip-path: polygon(0% 100%, 4px 100%, 4px 4px, 216px 4px, 216px 4px, 216px 4px, 216px 4px, 216px 4px, 100% 0%, 0% 0%);
}
75% {
-webkit-clip-path: polygon(0% 100%, 4px 100%, 4px 4px, 4px 4px, 4px 4px, 4px 4px, 4px 4px, 4px 4px, 4px 0%, 0% 0%);
}
100% {
-webkit-clip-path: polygon(0% 100%, 4px 100%, 4px 100%, 4px 100%, 4px 100%, 4px 100%, 4px 100%, 4px 100%, 4px 100%, 0% 100%);
}
}
@keyframes border {
0% {
-webkit-clip-path: polygon(0% 100%, 4px 100%, 4px 4px, 216px 4px, 216px 66px, 4px 66px, 4px 100%, 100% 100%, 100% 0%, 0% 0%);
}
25% {
-webkit-clip-path: polygon(0% 100%, 4px 100%, 4px 4px, 216px 4px, 216px 66px, 216px 66px, 216px 100%, 100% 100%, 100% 0%, 0% 0%);
}
50% {
-webkit-clip-path: polygon(0% 100%, 4px 100%, 4px 4px, 216px 4px, 216px 4px, 216px 4px, 216px 4px, 216px 4px, 100% 0%, 0% 0%);
}
75% {
-webkit-clip-path: polygon(0% 100%, 4px 100%, 4px 4px, 4px 4px, 4px 4px, 4px 4px, 4px 4px, 4px 4px, 4px 0%, 0% 0%);
}
100% {
-webkit-clip-path: polygon(0% 100%, 4px 100%, 4px 100%, 4px 100%, 4px 100%, 4px 100%, 4px 100%, 4px 100%, 4px 100%, 0% 100%);
}
}
CÁCH SỨ DỤNG
Để sử dụng button. các bạn viết bài như bình thường, sau đó chuyển qua tab html và dán đoạn code này vào chỗ cần hiển thị trong bài.
<a href="https://tienducblogvn.blogspot.com/2018/07/tao-button-co-hieu-ung-oi-mau-thu-zi.html"><span>DEMO BUTTON</span></a>
LỜI KẾT
Như vậy là mình đã chia sẻ xong cho các bạn một hiệu ứng Button cực kì ngầu và thú zị ! Chúc các bạn thành công.
Không có nhận xét nào