Skip to content

Commit c96cf77

Browse files
completed and checked against all the requirements
1 parent 56b4d1e commit c96cf77

2 files changed

Lines changed: 129 additions & 94 deletions

File tree

Form-Controls/formstyle.css

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
body {
2+
font-family: Arial, sans-serif;
3+
margin: 20px;
4+
}
5+
6+
header,
7+
footer {
8+
text-align: center;
9+
margin-bottom: 20px;
10+
}
11+
12+
form {
13+
max-width: 400px;
14+
margin: 0 auto;
15+
padding: 20px;
16+
border: 1px solid #ccc;
17+
border-radius: 5px;
18+
}
19+
20+
div {
21+
margin-bottom: 15px;
22+
}
23+
24+
label {
25+
display: block;
26+
margin-bottom: 5px;
27+
}
28+
29+
#red:checked + label {
30+
color: red;
31+
}
32+
33+
#green:checked + label {
34+
color: green;
35+
}
36+
37+
#blue:checked + label {
38+
color: blue;
39+
}
40+
41+
input[type="text"],
42+
input[type="email"],
43+
select {
44+
width: 100%;
45+
padding: 8px;
46+
box-sizing: border-box;
47+
}
48+
49+
button {
50+
padding: 10px 20px;
51+
background-color: rgb(62, 58, 58);
52+
color: white;
53+
border: none;
54+
border-radius: 5px;
55+
cursor: pointer;
56+
}
57+
58+
button:hover {
59+
background-color: rgb(152, 152, 160);
60+
font-weight: bold;
61+
}

Form-Controls/index.html

Lines changed: 68 additions & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -1,99 +1,73 @@
11
<!DOCTYPE html>
22
<html lang="en">
3-
<head>
4-
<meta charset="utf-8">
5-
<meta http-equiv="X-UA-Compatible" content="IE=edge">
6-
<title>My Form Exercise</title>
7-
<meta name="description" content="" />
8-
<meta name="viewport" content="width=device-width, initial-scale=1">
9-
<style>
10-
body {
11-
font-family: Arial, sans-serif;
12-
margin: 20px;
13-
}
14-
header, footer {
15-
text-align: center;
16-
margin-bottom: 20px;
17-
}
18-
form {
19-
max-width: 400px;
20-
margin: 0 auto;
21-
padding: 20px;
22-
border: 1px solid #ccc;
23-
border-radius: 5px;
24-
}
25-
div {
26-
margin-bottom: 15px;
27-
}
28-
label {
29-
display: block;
30-
margin-bottom: 5px;
31-
}
32-
input[type="text"],
33-
input[type="email"],
34-
select {
35-
width: 100%;
36-
padding: 8px;
37-
box-sizing: border-box;
38-
}
39-
button {
40-
padding: 10px 20px;
41-
background-color: black;
42-
color: white;
43-
border: none;
44-
border-radius: 5px;
45-
cursor: pointer;
46-
}
47-
button:hover {
48-
background-color: navy;
49-
}
50-
</style>
51-
</head>
52-
<body>
53-
<header>
54-
<h1>Pick Your Favourite T-Shirt</h1>
55-
</header>
56-
<main>
57-
<form>
58-
<div>
59-
<label for="name"> Your Name:</label>
60-
<input type="text" id="name" name="name" placeholder="Enter Your Name" pattern="\S{2,}" required/>
3+
4+
<head>
5+
<meta charset="utf-8">
6+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
7+
<title>My Form Exercise</title>
8+
<meta name="description" content="" />
9+
<meta name="viewport" content="width=device-width, initial-scale=1">
10+
<link rel="stylesheet" href="formstyle.css">
11+
</head>
12+
13+
<body>
14+
<header>
15+
<h1>Pick Your Favourite T-Shirt</h1>
16+
</header>
17+
18+
<main>
19+
<form>
20+
21+
<div>
22+
<label for="name">Your Name:</label>
23+
<input type="text" id="name" name="name" placeholder="Enter Your Name" pattern="\S{2,}" required />
24+
</div>
25+
26+
<div>
27+
<label for="email">Your Email:</label>
28+
<input type="email" id="email" name="email" placeholder="Enter Your Email" required />
29+
</div>
30+
31+
<div>
32+
<p>Pick Your Favourite Color:</p>
33+
34+
<div class="radio-group">
35+
<input type="radio" id="red" name="color" value="red" required>
36+
<label for="red">Red</label>
6137
</div>
62-
<div>
63-
<label for="email"> Your Email:</label>
64-
<input type="email" id="email" name="email" placeholder="Enter Your Email" required/>
38+
39+
<div class="radio-group">
40+
<input type="radio" id="green" name="color" value="green" required>
41+
<label for="green">Green</label>
6542
</div>
66-
Pick Your Favourite Color:
67-
<div>
68-
<label for="color-red">Red</label>
69-
<input type="radio" id="color-red" name="color" value="red" required/>
43+
44+
<div class="radio-group">
45+
<input type="radio" id="blue" name="color" value="blue" required>
46+
<label for="blue">Blue</label>
7047
</div>
71-
<div>
72-
<div>
73-
<label for="color-green">Green</label>
74-
<input type="radio" id="color-green" name="color" value="green" required/>
75-
</div>
76-
<label for="color-black">Black</label>
77-
<input type="radio" id="color-black" name="color" value="black" required/>
78-
</div>
79-
<div>
80-
<label for="size"> Choose Your T-Shirt Size:</label>
81-
<select id="size" name="size" required>
82-
<option value="">Select Size</option>
83-
<option value="xsmall">XS</option>
84-
<option value="small">S</option>
85-
<option value="medium">M</option>
86-
<option value="large">L</option>
87-
<option value="xlarge">XL</option>
88-
<option value="xxlarge">XXL</option>
89-
</select>
90-
</div>
91-
<button type="submit">Submit</button>
92-
</form>
93-
</main>
94-
<footer>
95-
<!-- change to your name-->
96-
<p>By Yonatan Teklemariam</p>
97-
</footer>
98-
</body>
99-
</html>
48+
</div>
49+
50+
<div>
51+
<label for="size">Choose Your T-Shirt Size:</label>
52+
<select id="size" name="size" required>
53+
<option value="">Select Size</option>
54+
<option value="xsmall">XS</option>
55+
<option value="small">S</option>
56+
<option value="medium">M</option>
57+
<option value="large">L</option>
58+
<option value="xlarge">XL</option>
59+
<option value="xxlarge">XXL</option>
60+
</select>
61+
</div>
62+
63+
<button type="submit">Submit</button>
64+
65+
</form>
66+
</main>
67+
68+
<footer>
69+
<p>By Yonatan Teklemariam</p>
70+
</footer>
71+
</body>
72+
73+
</html>

0 commit comments

Comments
 (0)