js+css实现图标伸缩式搜索框代码
代码语言:html
所属分类:搜索
代码描述:js+css实现图标伸缩式搜索框代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/ionicons.esm.js"></script> <script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/ionicons.7.1.0.js"></script> <style> * { margin: 0; padding: 0; box-sizing: border-box; } .container { width: 100vw; height: 100vh; display: flex; justify-content: center; align-items: center; background-color: #a1afc9; } .search-bar { width: 60px; height: 60px; background-color: #fff; box-shadow: 0 0 10px #999; /* 搜索栏会撑开,因此使用具体数值 */ border-radius: 60px; display: flex; align-items: center; position: relative; overflow: hidden; transition: all 0.3s ease-in; } .change-width { width: 500px; z-index: 1; } .search-icon { width: 60px; height: 60px; background-color: #4b5cc4; /* 搜索栏会撑开,因此使用具体数值 */ border-radius: 60px; display: flex; justify-content: center; align-items: center; cursor: po.........完整代码请登录后点击上方下载按钮下载查看
网友评论0