纯css3实现的搜索按钮展开动画特效代码

所属分类: 网页特效-动画效果    2023-12-10 11:59:35

纯css3实现的搜索按钮展开动画特效代码 ie兼容6
 查看演示  登录后下载 温馨提示
登录会员即可享受免费下载
 我要建站

纯css3实现的搜索按钮展开动画特效代码(共2个文件)

    • index.html

使用方法

body {
	font-family: sans-serif;

}
.cd__main{
	background: #337ab7;
	margin-left: 500px;
}

.button {
	display: inline-block;
	margin: 4px 2px;
	background-color: #444;
	font-size: 14px;
	padding-left: 32px;
	padding-right: 32px;
	height: 50px;
	line-height: 50px;
	text-align: center;
	color: white;
	text-decoration: none;
	cursor: pointer;
	-moz-user-select: none;
	-khtml-user-select: none;
	-webkit-user-select: none;
	-ms-user-select: none;
	user-select: none;
}

.button:hover {
	transition-duration: 0.4s;
	-moz-transition-duration: 0.4s;
	-webkit-transition-duration: 0.4s;
	-o-transition-duration: 0.4s;
	background-color: white;
	color: black;
}

.search-container {
	position: relative;
	display: inline-block;
	margin: 4px 2px;
	height: 50px;
	width: 50px;
	vertical-align: bottom;
}

.mglass {
	display: inline-block;
	pointer-events: none;
	-webkit-transform: rotate(-45deg);
	-moz-transform: rotate(-45deg);
	-o-transform: rotate(-45deg);
	-ms-transform: rotate(-45deg);
}

.searchbutton {
	position: absolute;
	font-size: 22px;
	width: 100%;
	margin: 0;
	padding: 0;
}

.search:focus + .searchbutton {
	transition-duration: 0.4s;
	-moz-transition-duration: 0.4s;
	-webkit-transition-duration: 0.4s;
	-o-transition-duration: 0.4s;
	background-color: white;
	color: black;
}

.search {
	position: absolute;
	left: 49px; /* Button width-1px (Not 50px/100% because that will sometimes show a 1px line between the search box and button) */
	background-color: white;
	outline: none;
	border: none;
	padding: 0;
	width: 0;
	height: 100%;
	z-index: 10;
	transition-duration: 0.4s;
	-moz-transition-duration: 0.4s;
	-webkit-transition-duration: 0.4s;
	-o-transition-duration: 0.4s;
}

.search:focus {
	width: 363px; /* Bar width+1px */
	padding: 0 16px 0 0;
}

.expandright {
	left: auto;
	right: 49px; /* Button width-1px */
}

.expandright:focus {
	padding: 0 0 0 16px;
}

站长提示:
1. 苦力吧素材官方QQ群:950875342
2. 平台上所有素材资源,需注册登录会员方能正常下载。
3. 会员用户积极反馈网站、素材资源BUG或错误问题,每次奖励2K币
4. PHP源码类素材,如需协助安装调试,或你有二次开发需求,可联系苦力吧客服。
5. 付费素材资源,需充值后方能下载,如有任何疑问可直接联系苦力吧客服
相关资源 / 动画效果

js+css实现的鼠标移动文本文字阴影动画特效代码

这个CSS代码片段可以帮助您在鼠标移动事件中创建文本阴影动画。移动鼠标时,文本文字会动态生成彩色阴影,从而增加了更吸引人的动画效果。
  动画效果
 4742  0

javascript带鼠标滑动控制的圆形进度滑块特效

一款环状进度滑块特效代码,用户可用交互方式选择圆形滑块内的范围。根据用户的鼠标拖动来计算所选范围,并更新显示相应数值。数值从0~100,圆中心数字颜色也从红色 - 黑色 - 绿色进行变换。
  动画效果
 1730  0

CSS3鼠标悬停图标导航动画特效代码

这是一款鼠标经过改变背景动画导航效果,可运用于水平导航菜单,可自定义动画设置。
  动画效果
 8606  0

jquery支持自定义的滚动定位插件

一款带动画特效的“滚动到”指定位置代码,带回调函数,滚动停止后返回信息提示。
  动画效果
 9723  0

评论数(0) 回复有机会获得K币 用户协议

^_^ 还没有人评论,快来抢个沙发!
😀
  • 😀
  • 😊
  • 😂
  • 😍
  • 😑
  • 😷
  • 😵
  • 😛
  • 😣
  • 😱
  • 😋
  • 😎
  • 😵
  • 😕
  • 😶
  • 😚
  • 😜
  • 😭
发表评论