css实现发光的input输入框

css实现发光的input输入框

鉴于前期工作总结,简单总结一下开发中经常遇到的发光的输入框UI视觉体验
聚焦input文本框:边框外围背景伴有明显的动画效果,呈现为虚化,雾化效果。


效果图截图:

这里写图片描述

案例代码示下:

<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>发光输入框</title>
		<style type="text/css">
			input{width: 280px;height: 30px;}
			textarea{width: 280px;height: 80px;}
			input,textarea{
				-webkit-transition: all 0.30s ease-in-out;
				-moz-transition: all 0.30s ease-in-out;
				-ms-transition: all 0.30s ease-in-out;
				-o-transition: all 0.30s ease-in-out;
				
				outline: none;
				padding: 3px 0 3px 3px;
				margin: 5px 1px 3px 0;
				border: #ddd 1px solid;
			}
			
			input:focus,textarea:focus{
				box-shadow: 0 0 5px rgba(216,76,41,1);
				padding: 3px 0 3px 3px;
				margin: 5px 1px 3px 0;
				border: rgba(216,76,41,1) 1px solid;
			}
		</style>
	</head>
	<body>
	
		<input type="text" name="" id="" value="" />
		
		<textarea></textarea>
		
	</body>
</html>

注意:
  1. 这里使用了csstransition 动画属性
  2. transition浏览器兼容性,添加浏览器厂商前缀

以上就是关于 “ css实现发光的input输入框 ” 的全部内容。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值