开发测试

CSS3点击按钮后高亮代码

.catalog-item {
	border:2rpx solid #06AD56;
	border-radius: 10rpx;
	height:60rpx;
	line-height: 60rpx;
	width:100%;
	text-align: center;
	margin-bottom: 24rpx;
	position: relative;
}

.catalog-item:before{
	content: '';
	width: 100%;
	height: 100%;
	position: absolute;
	left: 0;
	top: 0;
	background-color:#ddd;
	background-repeat: no-repeat;
	background-position: center;
	background-size: 100% 100%;
	opacity: 0;
	pointer-events: none;
	-webkit-transition: opacity 600ms;
	transition: opacity 600ms;   /*加上动画显得更自然*/
}

.catalog-item:active:before{
	opacity: 1;
	-webkit-transition: opacity 150ms;
	transition: opacity 150ms;
}


作者:lzcz 分类:经验分享 浏览:394 评论:0