-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathform.html
100 lines (86 loc) · 3.05 KB
/
form.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>HTML Form</title>
<style>
/* Form container styling */
.form-container {
max-width: 400px;
margin: 0 auto;
padding: 20px;
border: 1px solid #ccc;
background-color: #f7f7f7;
}
/* Input field styling */
.form-input {
width: 100%;
padding: 10px;
margin-bottom: 10px;
border: 1px solid #ccc;
border-radius: 4px;
}
/* Label styling */
label {
font-weight: bold;
}
/* Checkbox and radio button styling */
.form-checkbox,
.form-radio {
margin-right: 5px;
}
/* Select menu styling */
.form-select {
width: 100%;
padding: 10px;
margin-bottom: 10px;
border: 1px solid #ccc;
border-radius: 4px;
}
/* Submit button styling */
.form-submit {
background-color: #007bff;
color: #fff;
padding: 10px 20px;
border: none;
border-radius: 4px;
cursor: pointer;
}
/* Hover effect for the submit button */
.form-submit:hover {
background-color: #0056b3;
}
</style>
</head>
<body>
<div class="form-container">
<h2>Contact Us</h2>
<form action="#" method="post">
<label for="name">Name:</label>
<input type="text" id="name" name="name" class="form-input" required>
<label for="email">Email:</label>
<input type="email" id="email" name="email" class="form-input" required>
<label>Gender:</label>
<input type="radio" id="male" name="gender" value="male" class="form-radio">
<label for="male" class="form-checkbox">Male</label>
<input type="radio" id="female" name="gender" value="female" class="form-radio">
<label for="female" class="form-checkbox">Female</label>
<br>
<label>Interests:</label>
<input type="checkbox" id="sports" name="interests[]" value="sports" class="form-checkbox">
<label for="sports" class="form-checkbox">Sports</label>
<input type="checkbox" id="music" name="interests[]" value="music" class="form-checkbox">
<label for="music" class="form-checkbox">Music</label>
<br>
<label for="country">Country:</label>
<select id="country" name="country" class="form-select">
<option value="India">India</option>
<option value="canada">Canada</option>
<option value="uk">UK</option>
</select>
<button type="submit" class="form-submit">Submit</button>
</form>
</div>
</body>
</html>