输入框输入建议效果

代码语言:html

所属分类:表单美化

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">

<style>
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

::-moz-selection {
  color: #222;
  background: rgba(0, 0, 0, 0.12);
}

::selection {
  color: #222;
  background: rgba(0, 0, 0, 0.12);
}

body {
  width: 100%;
  height: 100vh;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #52de97;
}

input {
  outline: none;
  border: 0;
}

.icons {
  display: none;
}

.app {
  width: 400px;
  height: 400px;
  display: grid;
  place-items: center;
}
.app .input-container {
  position: relative;
  width: 360px;
  height: 65px;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 6.7px 5.3px rgba(0, 0, 0, 0.044), 0 22.3px 17.9px rgba(0, 0, 0, 0.066), 0 100px 80px rgba(0, 0, 0, 0.11);
  backface-visibility: hidden;
  transform: translateZ(0) scale(1, 1);
}
.app .input-container.animate {
  animation: stretch-animation 800ms ease;
}
.app .input-container [type="text"] {
  position: absolute;
  width: 360px;
  height: 65px;
  color: #52de97;
  font-family: "sans-serif";
  font-size: 18px;
  letter-spacing: 2px;
  padding: 0px 45px 0px 18px;
  caret-color: #000;
  background: transparent;
  z-index: 5;
}
.app .input-container [type="text"]::placeholder {
  color: rgba(34, 34, 34, 0.55);
}
.app .input-container .suggestion-container {
  width: 360px;
  height: 65px;
  position: absolute;
  left: 0;
  top: 0;
  display: flex;
  align-items: .........完整代码请登录后点击上方下载按钮下载查看

网友评论0