본문으로 바로가기

Collection of Button Hover Effects

category StyleSheet/CSS 2017. 2. 25. 10:16

CSS3 버튼 효과

이 포스팅에서는 CSS3 로 마우스 오버시에 따른 버튼 효과에 대해 알아봅니다.



CSS3 Button Hover Source

See the Pen 마우스 오버 버튼 CSS3 효과 by jaeheekim (@jaehee) on CodePen.


CSS Source Preview

css
[class*="btn-"] {
	position: relative;
	display: inline-block;
	width: 100%;
	color: #fff;
	font-size: 16px;
	line-height: 45px;
	margin-right:3em;
	max-width: 160px;
	text-decoration: none;
	text-transform: uppercase;
	vertical-align: middle;
}

/**
 * ===========================
 * @class : btn-1
 * ===========================
 */
.btn-1 {
	letter-spacing: 0;
	-webkit-transition: all .28s ease-in-out;
	transition: all .28s ease-in-out;
}
.btn-1:hover,
.btn-1:focus,
.btn-1:active {
	letter-spacing: 5px;
}
.btn-1:after,
.btn-1:before {
	border: 1px solid rgba(255, 255, 255, 0);
	bottom: 0;
	content: " ";
	display: block;
	margin: 0 auto;
	position: relative;
	-webkit-transition: all .28s ease-in-out;
	transition: all .28s ease-in-out;
	width: 0;
}
.btn-1:hover:after,
.btn-1:hover:before {
	border-color: #fff;
	-webkit-transition: width 350ms ease-in-out;
	transition: width 350ms ease-in-out;
	width: 70%;
}
.btn-1:hover:before {
	bottom: auto;
	top: 0;
}

/**
 * ===========================
 * @class : btn-2
 * ===========================
 */
.btn-2 {
	background: #e3403a;
	border: 1px solid #da251f;
	box-shadow: 0 2px 0 #d6251f, 2px 4px 6px #e02a24;
	font-weight: bold;
	letter-spacing: 1px;
	-webkit-transition: all .15s linear;
	transition: all .15s linear;
}
.btn-2:hover {
	background: #e02c26;
	border: 1px solid rgba(0, 0, 0, 0.05);
	box-shadow: 1px 1px 2px rgba(255, 255, 255, 0.2);
	color: #ec817d;
	text-shadow: -1px -1px 0 #c2211c;
}

/**
 * ===========================
 * @class : btn-3
 * ===========================
 */
.btn-3 {
	border: 1px solid;
	overflow: hidden;
	position: relative;
}
.btn-3 span {
	z-index: 2;
}
.btn-3:after {
	content: "";
	height: 155px;
	left: -75px;
	opacity: .2;
	position: absolute;
	top: -50px;
	background: #fff;
	-webkit-transform: rotate(35deg);
	transform: rotate(35deg);
	-webkit-transition: all .55s cubic-bezier(0.19, 1, 0.22, 1);
	transition: all .55s cubic-bezier(0.19, 1, 0.22, 1);
	width: 50px;
	z-index: -1;
}
.btn-3:hover:after {
	left: 120%;
}

/**
 * ===========================
 * @class : btn-4
 * ===========================
 */
.btn-4 {
	border: 0 solid;
	box-shadow: inset 0 0 20px rgba(255, 255, 255, 0);
	outline: 1px solid rgba(255, 255, 255, 0.5);
	-webkit-transition: all 1.25s cubic-bezier(0.19, 1, 0.22, 1);
	transition: all 1.25s cubic-bezier(0.19, 1, 0.22, 1);
}
.btn-4:hover {
	border: 1px solid;
	box-shadow: inset 0 0 20px rgba(255, 255, 255, 0.5), 0 0 20px rgba(255, 255, 255, 0.2);
	outline-color: rgba(255, 255, 255, 0);
	outline-offset: 15px;
	text-shadow: 1px 1px 2px #427388;
}



Jaehee's WebClub


'StyleSheet > CSS' 카테고리의 다른 글

:target selector 를 이용한 Panel Menu  (0) 2017.02.27
Pure CSS Tabs (:target selector)  (1) 2017.02.26
Image Hover Effects Collection  (0) 2017.02.23
CSS3 Checkbox Styles Collection  (0) 2017.02.23
CSS3 Menu Animation  (2) 2017.02.22