css发光按钮

html部分:

<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width,initial-scale=1.0"/>
		<title>发光按钮</title>
		<link rel="stylesheet" href="css/index.css">
	</head>
	<body>
		<div class="container">
			<a href="javascript:void(0);">点赞</a>
			<a href="javascript:void(0);">评论</a>
			<a href="javascript:void(0);">转发</a>
			<a href="javascript:void(0);">关注</a>
			
		</div>
	</body>
</html>

css部分:

*{
	/* 初始化,清除页面元素的内外边距 */
	padding: 0;
	margin: 0;
	
}
.container{
	/* 弹性元素 让页面元素垂直水平居中 */
	display: flex;
	justify-content: center;
	align-items: center;
	/* 子元素垂直排列 */
	flex-direction: column;
	/* 宽站浏览器可视窗口总宽度 */
	width: 100 vm;
	height: 100vh;
	background-color: #000000;
}
.container a{
	/* 相对定位 */
	position: relative;
	/* 将行内元素转化成块级元素 不然无法设置宽高 */
	display: block;
	width: 140px;
	height: 60px;
	/* 行高 */
	line-height: 60px;
	text-align: center;
	margin: 40px;
	color: aquamarine;
	font-size: 20px;
	text-decoration: none;
	transition: all 0.5s ease-in-out;
/* 	filter: hue-rotate(calc(var(--i)*60deg)); */
}
.container a::before,.container a::after{
	/*将伪元素的相同部分写在一起 */
	content: "";
	position: absolute;
	width: 20px;
	height: 20px;
	border: 1px solid aquamarine;
	transition: all 0.5s ease-in-out;
}
.container a::before{
	top: 0;
	left: 0;
	/* 删除左边的伪元素的右边和下边边框 */
	border-bottom: 0;
	border-right: 0;
}
.container a::after{
	right: 0;
	bottom: 0;
	/* 删除右边伪元素的上边和左边的边框 */
	border-top: 0;
	border-left: 0;
}
.container a:hover{
	background-color: aquamarine;
	color: #000000;
	/* 加发光效果和下面的倒影 模糊度加到50px */
	box-shadow: 0 0 50px aquamarine;
	-webkit-box-reflect: below 1px 
	linera-gradient(transparent,rgba(0,0,0,.3));
	/* below是下倒影 1px是倒影的元素相隔的距离  最后时渐变的颜色*/
	transition-delay: 0.4s;
}

效果图:
在这里插入图片描述

  • 2
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值