サンプル

See the Pen Codepen by Tora (@webtoranomaki) on CodePen.

コード


<a class="btn btn01" href="#">Button</a>

.btn {
	display: inline-block;
	width: 200px;
	height: 50px;
	line-height: 50px;
	text-align: center;
	-webkit-transition: .3s;
	transition: .3s;
}
.btn01 {
	position: relative;
	color: #333;
	border: 1px solid #333;
	background-color: #fff;
	z-index: 2;
	-webkit-perspective: 200px;
	perspective: 200px;
	-webkit-transform-style: preserve-3d;
	transform-style: preserve-3d;
}
.btn01::after {
	position: absolute;
	z-index: -1;
	display: block;
	content: '';
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	-webkit-transform-origin: center top;
	transform-origin: center top;
	-webkit-transform: rotateX(90deg);
	transform: rotateX(90deg);
	opacity: 0;
	-webkit-transition: .3s;
	transition: .3s;
}
.btn01:hover {
	color: #fff;
}
.btn01:hover::after {
	background: #333;
	-webkit-transform: rotateX(0);
	transform: rotateX(0);
	opacity: 1;
}