-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcss-pseudoclasss-4.html
190 lines (171 loc) · 3.47 KB
/
css-pseudoclasss-4.html
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
<!DOCTYPE html>
<html>
<head>
<title>Css Pseduo CLasees form</title>
<style type="text/css">
/* var decalred krne ke */
:root{
--main-color:red;
}
/*<!-- attribute selector -->*/
input[type=text]{
background-color: var(--main-color);
}
input[type=text]:focus{
background-color: blue;
}
/* checked checkbox usko target krne ke liye*/
input[type='checkbox']:checked{
color:red;
box-shadow: 0 0 0 3px red;
}
input[type='checkbox']:checked + label{
/*font-family: cursive;*/
color: green;
}
input[type=radio]:checked{
color:red;
box-shadow: 0 0 0 3px red;
}
input[type=radio]:checked + label{
/*font-family: cursive;*/
color: green;
}
/* jo inout field disbled hai usko target*/
input:disabled{
background:red;
box-shadow: 0 0 0 3px;
}
/* target enabled input fileds*/
input:enabled{
background:orange;
}
/*css3 -> select required input field*/
input:required{
background-color: cyan;
}
/*css3 -> select (!required)optional input field*/
input:optional{
background-color: tan;
}
/*css3 - type -> number */
/*in-range / out-of-range*/
input:in-range{
border:2px solid green;
background: green;
}
input:out-of-range{
border:2px solid red;
background: red;
}
/*css3 => readonly/read-write*/
input:read-only{
background-color: silver;
}
input:read-write{
background-color: gold;
}
/*validation ?/ */
input:valid{
border:2px solid green;
background-color: green;
}
input:invalid{
border:2px solid red;
background-color: red;
}
/*:default-> checkbox,radio,option*/
input:default + label{
box-shadow: 0 0 0 3px orange;
font-family: fantasy;
}
option:default{
/*box-shadow: 0 0 0 3px orange;*/
font-family: fantasy;
}
</style>
</head>
<body>
<form>
<table>
<tbody>
<tr>
<td>
<label>First Name</label>
</td>
<td>
<input type="text" name="" required>
</td>
</tr>
<tr>
<td>
<label>Last Name</label>
</td>
<td>
<input type="text" value="XYZ" disabled>
</td>
</tr>
<tr>
<td>
<label>Age Name</label>
</td>
<td>
<input type="number" name="" min="20" max="100" readonly>
</td>
</tr>
<tr>
<td>
<label>EMail Id</label>
</td>
<td>
<input type="email" name="" >
</td>
</tr>
<tr>
<td>
<label>Your Hobbies</label>
</td>
<td>
<input type="checkbox" checked name="swimming">
<label>Swimming</label>
</td>
<td>
<input type="checkbox" name="driving">
<label>Driving</label>
</td>
</tr>
<tr>
<td>
<label>Gender</label>
</td>
<td>
<input type="radio" checked name="gender">
<label>male</label>
</td>
<td>
<input type="radio" name="gender">
<label>female</label>
</td>
</tr>
<tr>
<td>Select SKill</td>
<td>
<select name="skills">
<option value="html" >HTML</option>
<option value="css" selected>CSS</option>
</select>
</td>
</tr>
<tr>
<td>
<input type="submit" value="Submit Form">
</td>
<td>
<input type="reset" value="Reset Form">
</td>
</tr>
</tbody>
</table>
</form>
</body>
</html>