File tree Expand file tree Collapse file tree 1 file changed +60
-0
lines changed Expand file tree Collapse file tree 1 file changed +60
-0
lines changed Original file line number Diff line number Diff line change 1+ <!DOCTYPE html>
2+ < html lang ="en ">
3+ < head >
4+ < meta charset ="UTF-8 ">
5+ < meta name ="viewport " content ="width=device-width, initial-scale=1.0 ">
6+ < title > CSS Only Password Strength Meter</ title >
7+ < style >
8+ * {
9+ box-sizing : border-box;
10+ }
11+
12+ input : invalid ~ .strength ::before {
13+ width : 30% ;
14+ background : # ff4d4d ;
15+ }
16+
17+ input : valid ~ .strength ::before {
18+ width : 100% ;
19+ background : # 4caf50 ;
20+ }
21+
22+ input : not (: placeholder-shown ): not (: valid ): not (: invalid ) ~ .strength ::before {
23+ width : 60% ;
24+ background : # fbc02d ;
25+ }
26+
27+ .hint {
28+ font-size : 13px ;
29+ color : # 666 ;
30+ margin-top : 10px ;
31+ text-align : left;
32+ }
33+
34+ input : valid {
35+ border-color : # 4caf50 ;
36+ box-shadow : 0 0 8px rgba (76 , 175 , 80 , 0.3 );
37+ }
38+
39+ input : invalid {
40+ border-color : # ff4d4d ;
41+ }
42+ </ style >
43+ </ head >
44+ < body >
45+
46+ < div class ="container ">
47+ < h2 > Create Password</ h2 >
48+ < form >
49+ < input type ="password " placeholder ="Enter password "
50+ pattern ="(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[!@#$%^&*]).{8,} " required >
51+ < div class ="strength "> </ div >
52+ < div class ="hint ">
53+ Must contain at least 8 characters, including< br >
54+ 1 uppercase, 1 lowercase, 1 number, and 1 symbol.
55+ </ div >
56+ </ form >
57+ </ div >
58+
59+ </ body >
60+ </ html >
You can’t perform that action at this time.
0 commit comments