autoComplete实现搜索自动弹出下拉推荐框效果代码
代码语言:html
所属分类:搜索
代码描述:autoComplete实现搜索自动弹出下拉推荐框效果代码,无需其他依赖插件
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<link type="text/css" rel="stylesheet" href="//repo.bfw.wiki/bfwrepo/css/autoComplete.css">
<style>
:root {
--transition-1: all 0.3s ease-in-out;
--transition-2: all 0.1s ease-in-out;
}
html {
font-size: 1rem;
font-family: "PT Sans", sans-serif;
}
body {
margin: 0;
padding-top: 50px;
background: white;
}
.contaier {
width: 100vw;
height: 100vh;
}
.header {
text-align: center;
-ms-user-select: none;
user-select: none;
-webkit-user-select: none;
-moz-user-select: none;
-webkit-touch-callout: none;
}
.no_result {
margin: 0.15rem auto;
padding: 0.6rem;
max-width: 280px;
border: 0.05rem solid #e3e3e3;
list-style: none;
text-align: left;
font-size: 1.1rem;
color: rgb(123, 123, 123);
-webkit-transition: all 0.1s ease-in-out;
transition: all 0.1s ease-in-out;
background-color: #fff;
border-radius: 0 0 1rem 1rem;
outline: none;
}
.no_result:hover {
cursor: default;
background-color: #fff;
border: 0.05rem solid #e3e3e3;
}
.no_result:focus {
cursor: default;
background-color: #fff;
border: 0.05rem solid #e3e3e3;
}
.in {
padding: 0 2rem 0 3.5rem;
color: rgba(255, 122, 122, 1);
height: 3rem;
width: 16.5rem;
border: 0.05rem solid rgb(255, 122, 122);
background: url("./images/magnifier.svg") no-repeat left/15% 1.5rem;
box-shadow: rgba(255, 122, 122, 0.1) 0px 0px 20px 5px;
position: relative;
font-size: 1.2rem;
outline: none;
border-radius: 50rem;
border: 0.05rem solid rgb(255, 122, 122);
caret-color: rgb(255, 122, 122);
-webkit-transition: all 0.4s ease;
transition: all 0.4s ease;
-webkit-transition: all -webkit-transform 0.4s ease;
text-overflow: ellipsis;
}
.out .........完整代码请登录后点击上方下载按钮下载查看
















网友评论0