123.wrapper {4 position: relative;5}6.input {7 width: 190px;8 height: 35px;9 border-radius: 5px;10 border: 2px #323232 solid;11 padding: 5px 15px;12 background-color: #e8e8e8;13 font-size: 15;14 font-weight: 500;15}16.placeholder {17 width: 65%;18 position: absolute;19 top: -18px;20 left: 50%;21 transform: translateX(-50%);22 z-index: 2;23 text-align: center;24 color: blueviolet;25 background-color: #e8e8e8;26 font-weight: 600;27 font-size: 15px;28 letter-spacing: 1.5px;29 transition: all 0.3s;30 opacity: 0;31}32.input::placeholder {33 font-size: 15px;34 font-weight: 500;35 letter-spacing: 1px;36}37.input:focus + .placeholder {38 opacity: 1;39}40.input:focus {41 outline: 2px solid blueviolet;42 border: none;43 color: blueviolet;44}45.input:focus::placeholder {46 opacity: 0;47}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
.wrapper {
position: relative;
}
.input {
width: 190px;
height: 35px;
border-radius: 5px;
border: 2px #323232 solid;
padding: 5px 15px;
background-color: #e8e8e8;
font-size: 15;
font-weight: 500;
}
.placeholder {
width: 65%;
position: absolute;
top: -18px;
left: 50%;
transform: translateX(-50%);
z-index: 2;
text-align: center;
color: blueviolet;
background-color: #e8e8e8;
font-weight: 600;
font-size: 15px;
letter-spacing: 1.5px;
transition: all 0.3s;
opacity: 0;
}
.input::placeholder {
font-size: 15px;
font-weight: 500;
letter-spacing: 1px;
}
.input:focus + .placeholder {
opacity: 1;
}
.input:focus {
outline: 2px solid blueviolet;
border: none;
color: blueviolet;
}
.input:focus::placeholder {
opacity: 0;
}
You need to sign in before you can write a comment.