-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy path6_form.html
More file actions
102 lines (83 loc) · 2.3 KB
/
6_form.html
File metadata and controls
102 lines (83 loc) · 2.3 KB
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
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Q.6 Styled Form</title>
<style>
body {
font-family: Arial, sans-serif;
}
fieldset {
border: 2px solid #333;
padding: 10px;
margin: 20px;
width: 300px;
}
label {
display: block;
margin-bottom: 5px;
}
input[type='text']:focus,
textarea:focus {
background-color: yellow;
color: blue;
}
select:checked {
height: 150px;
}
input:invalid,
textarea:invalid {
border: 2px solid red;
}
input:valid,
textarea:valid {
border: 2px solid green;
}
input,
textarea,
select {
margin-bottom: 10px;
width: 100%;
padding: 8px;
box-sizing: border-box;
}
input[type='checkbox'] {
width: auto;
margin-right: 5px;
}
</style>
</head>
<body>
<form>
<fieldset>
<legend>Styled Form Controls</legend>
<label for="text">Text:</label>
<input type="text" id="text" required />
<label for="email">Email:</label>
<input type="email" id="email" required />
<label for="password">Password:</label>
<input type="password" id="password" required />
<label for="checkbox">Checkbox:</label>
<input type="checkbox" id="checkbox" />
<label for="radio">Radio:</label>
<input type="radio" id="radio" />
<label for="select">Select:</label>
<select id="select" required>
<option value="option1">Option 1</option>
<option value="option2">Option 2</option>
<option value="option3">Option 3</option>
</select>
<label for="textarea">Textarea:</label>
<textarea id="textarea" rows="4" required></textarea>
<label for="date">Date:</label>
<input type="date" id="date" required />
<label for="number">Number:</label>
<input type="number" id="number" required />
<label for="color">Color:</label>
<input type="color" id="color" required />
<input type="submit" value="Submit" />
</fieldset>
</form>
</body>
</html>