搜索框占位符打字效果

代码语言:html

所属分类:搜索

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

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

<title>Placeholder Typing Text</title>
   <link href='https://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css' rel='stylesheet' />
<style>
      @import url(https://fonts.googleapis.com/css?family=PT+Sans:400,700);
html {

background: black;
  padding-top: 50px;
}

h1 {
  text-shadow: 1px 1px 10px rgba(0, 0, 0, 0.5);
}

h1, h2 {
  text-align: center;
  color: white;
  font-size: 2.5em;
  line-height: 1.3em;
  font-weight: 300;
}

h2 {
  margin-top: 100px;
  font-size: 1.3em;
  font-style: italic;
  font-weight: 100;
}

.body {
  width: 100%;
  height: 250px;
  box-sizing: border-box;
}

input {
  box-sizing: border-box;
  font-size: 13px;
  vertical-align: top;
}

.wrapper {
  text-align: center;
  position: relative;
  height: 80px;
  font-size: 0;
  top: 50%;
  -webkit-transform: translateY(-50%);
          transform: translateY(-50%);
}

.search {
  padding: 0 30px;
  font-size: 18px;
  width: 60%;
  max-width: 400px;
  height: 80px;
  border: 1px solid #b3b3b3;
  border-radius: 20px 0 0 20px;
}

.submit {
  cursor: pointer;
  border: none;
  background-size: 35px 35px;
  border-radius: 0 20px 20px 0;
  padding: 15px 25px;
  display: inline-block;
  width: 150px;
  height: 80px;
  background: #2596cc;
  color: white;
}

    </style>

</script>
</head>
<body translate="no">
<div class="body">
<h1>搜索框占位符打字效果</h1>
<div class="wrapper">
<input class="search" type="text" id="search" />
<button type="submit" class="submit"><i class="fa fa-search  fa.........完整代码请登录后点击上方下载按钮下载查看

网友评论0