html5文本框特效,html

css

html,

body {

background-color: #F4F4F4;

display: flex;

width: 100%;

height: 100%;

align-items: center;

font-family: "Work Sans", sans-serif;

justify-content: center;

}

.exp-container {

width: 100%;

padding: 30px;

box-sizing: border-box;

max-width: 600px;

}

.exp {

display: flex;

flex-direction: column-reverse;

width: 100%;

margin-bottom: 30px;

position: relative;

flex-wrap: wrap;

}

.exp__label {

transition: 0.3s;

margin-bottom: 5px;

}

.exp__label:before {

content: attr(data-icon);

font-weight: normal;

font-family: "Ionicons";

font-size: 24px;

position: absolute;

left: 0;

transform: rotateY(90deg);

bottom: 0;

height: 52px;

background: transparent;

color: #000;

transform-origin: left;

display: flex;

align-items: center;

justify-content: center;

transition: color .3s 0s ease, transform .3s 0s ease;

width: 42px;

}

.exp__input {

border: 1px solid #ddd;

padding: 0 10px;

width: 100%;

height: 52px;

transition: 0.3s;

font-weight: normal;

box-sizing: border-box;

font-family: "Work Sans", sans-serif;

outline: none;

}

.exp__input:focus {

padding-left: 42px;

border-color: #bbb;

}

.exp__input:focus + label:before {

transform: rotateY(0deg);

}

.exp__input:valid {

padding-left: 42px;

border-color: green;

}

.exp__input:valid + label {

color: green;

}

.exp__input:valid + label:before {

transform: rotateY(0deg);

color: green;

font-size: 34px;

content: attr(data-icon-ok);

}

.exp-title {

text-align: center;

font-size: 22px;

margin-bottom: 30px;

font-weight: normal;

}

.exp-title span {

display: inline-block;

padding: 5px;

font-size: 22px;

background: #feffd4;

}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值