8种不同的带标题的input框输入效果代码
代码语言:html
所属分类:表单美化
代码描述:8种不同的带标题的input框输入效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<link type="text/css" rel="stylesheet" href="//repo.bfw.wiki/bfwrepo/css/normalize.min.css">
<style>
@import url(https://fonts.googleapis.com/css?family=Open+Sans:400,700,600,300,800);
* {
box-sizing: border-box;
}
html,
body {
overflow-x: hidden;
font-family: "Open Sans", sans-serif;
font-weight: 300;
color: #fff;
background: #efefef;
}
.row {
max-width: 800px;
margin: 0 auto;
padding: 60px 30px;
background: #032429;
position: relative;
z-index: 1;
text-align: center;
}
.row:before {
position: absolute;
content: "";
display: block;
top: 0;
left: -5000px;
height: 100%;
width: 15000px;
z-index: -1;
background: inherit;
}
.row:first-child {
padding: 40px 30px;
}
.row:nth-child(2), .row:nth-child(8), .row:nth-child(10) {
background: #134A46;
}
.row:nth-child(3), .row:nth-child(7) {
background: #377D6A;
}
.row:nth-child(4), .row:nth-child(6) {
background: #7AB893;
}
.row:nth-child(5) {
background: #B2E3AF;
}
.row span {
position: relative;
display: inline-block;
margin: 30px 10px;
}
.basic-slide {
display: inline-block;
width: 215px;
padding: 10px 0 10px 15px;
font-family: "Open Sans", sans;
font-weight: 400;
color: #377D6A;
background: #efefef;
border: 0;
border-radius: 3px;
outline: 0;
text-indent: 70px;
transition: all .3s ease-in-out;
}
.basic-slide::-webkit-input-placeholder {
color: #efefef;
text-indent: 0;
font-weight: 300;
}
.basic-slide + label {
display: inline-block;
position: absolute;
top: 0;
left: 0;
padding: 10px 15px;
text-shadow: 0 1px 0 rgba(19, 74, 70, 0.4);
background: #7AB893;
transition: all .3s ease-in-out;
border-top-left-radius: 3px;
border-bottom-left-radius: 3px;
}
.basic-slide:focus,
.basic-slide:active {
color: #377D6A;
text-indent: 0;
background: #fff;
border-top-left-radius: 0;
border-bottom-left-radius: 0;
}
.basic-slide:focus::-webkit-input-placeholder,
.basic-slide:active::-webkit-input-placeholder {
color: #aaa;
}
.basic-slide:focus + label,
.basic-slide:active + label {
transform: translateX(-100%);
}
.clean-slide {
position: relative;
display: inline-block;
width: 215px;
padding: 10px 0 10px 15px;
font-family: "Open Sans", sans;
font-weight: 400;
color: #377D6A;
background: #efefef;
border: 0;
border-radius: 3px;
outline: 0;
text-indent: 60px;
transition: all .3s ease-in-out;
}
.clean-slide::-webkit-input-placeholder {
color: #efefef;
text-indent: 0;
font-weight: 300;
}
.clean-slide + label {
display: inline-block;
position: absolute;
transform: translateX(0);
top: 0;
left: 0;
bottom: 0;
padding: 13px 15px;
font-size: 11px;
font-weight: 700;
text-transform: uppercase;
color: #032429;
text-align: left;
text-shadow: 0 1px 0 rgba(255, 255, 255, 0.4);
transition: all .3s ease-in-out, color .3s ease-out;
border-top-left-radius: 3px;
border-bottom-left-radius: 3px;
overflow: hidden;
}
.clean-slide + label:after {
content: "";
position: absolute;
top: 0;
right: 100%;
bottom: 0;
width: 100%;
background: #7AB893;
z-index: -1;
transform: translate(0);
transition: all .3s ease-in-out;
border-top-left-radius: 3px;
border-bottom-left-radius: 3px;
}
.clean-slide:focus,
.clean-slide:active {
color: #377D6A;
text-indent: 0;
background: #fff;
border-top-left-radius: 0;
border-bottom-left-radius: 0;
}
.clean-slide:focus::-webkit-input-placeholder,
.clean-slide:active::-webkit-input-placeholder {
color: #aaa;
}
.clean-slide:focus + label,
.clean-slide:active + label {
color: #fff;
text-shadow: 0 1px 0 rgba(19, 74, 70, 0.4);
transform: translateX(-100%);
}
.clean-slide:focus + label:after,
.clean-slide:active + label:after {
transform: translate(100%);
}
.gate {
display: inline-block;
width: 215px;
padding: 10px 0 10px 15px;
font-family: "Open Sans", sans;
font-weight: 400;
color: #377D6A;
background: #efefef;
border: 0;
border-radius: 3px;
outline: 0;
text-indent: 65px;
transition: all .3s ease-in-out;
}
.gate::-webkit-input-placeholder {
color: #efefef;
text-indent: 0;
font-weight: 300;
}
.gate + label {
display: inline-block;
position: absolute;
top: 0;
left: 0;
padding: 10px 15px;
text-shadow: 0 1px 0 rgba(19, 74, 70, 0.4);
background: #7AB893;
transition: all .4s ease-in-out;
border-top-left-radius: 3px;
border-bottom-left-radius: 3px;
transform-origin: left bottom;
z-index: 99;
}
.gate + label:before, .gate + label:after {
content: "";
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
border-radius: 3px;
background: #377D6A;
transform-origin: left bottom;
transition: all .4s ease-in-out;
pointer-events: none;
z-index: -1;
}
.gate + label:before {
background: rgba(3, 36, 41, 0.2);
z-index: -2;
right: 20%;
}
span:nth-child(2) .gate {
text-indent: 85px;
}
span:nth-child(2) .gate:focus,
span:nth-child(2) .gate:active {
text-indent: 0;
}
.gate:focus,
.gate:active {
color: #377D6A;
text-indent: 0;
background: #fff;
border-top-right-radius: 3px;
border-bottom-right-radius: 3px;
}
.gate:focus::-webkit-input-placeholder,
.gate:active::-webkit-input-placeholder {
color: #aaa;
}
.gate:focus + label,
.gate:active + label {
transform: rotate(-66deg);
border-radius: 3px;
}
.gate:focus + label:before,
.gate:active + label:before {
transform: rotate(10deg);
}
.skinny {
display: inline-block;
width: 215px;
padding: 10px 0 10px 15px;
font-family: "Open Sans", sans;
font-weight: 400;
color: #377D6A;
background: #efefef;
border: 0;
border-radius: 3px;
outline: 0;
text-indent: 75px;
transition: all .3s ease-in-out;
}
.skinny::-webkit-input-placeholder {
color: #efefef;
text-indent: 0;
font-weight: 300;
}
.skinny + label {
display: inline-block;
position: absolute;
transform: translateX(0);
top: 0;
left: 0;
padding: 10px 15px;
text-shadow: 0 1px 0 rgba(19, 74, 70, 0.4);
transition: all .3s ease-in-out;
border-top-left-radius: 3px;
border-bottom.........完整代码请登录后点击上方下载按钮下载查看
网友评论0