Skip to content

Commit b87b689

Browse files
fix: update semantic tags, fix footer, and convert colour input to radio buttons
1 parent f25e43b commit b87b689

2 files changed

Lines changed: 139 additions & 70 deletions

File tree

Form-Controls/index.html

Lines changed: 69 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -1,74 +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-
</head>
10-
<body>
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
<title>T-Shirt Order Form</title>
7+
<link rel="stylesheet" href="style.css">
8+
</head>
9+
<body>
10+
11+
<!-- 1. Header before Main -->
12+
<header>
13+
<h1>T-Shirt Order Form</h1>
14+
</header>
15+
16+
<!-- 2. Main Content Container -->
17+
<main>
1118
<form>
12-
<!-- 1. Customer Name (At least 2 non-space characters using pattern regex) -->
13-
<div>
14-
<label for="name">Name:</label>
15-
<input
16-
type="text"
17-
id="name"
18-
name="name"
19-
pattern=".*\S.*\S.*"
20-
title="Name must contain at least two non-space characters."
21-
required
22-
>
23-
</div>
24-
<!-- 2. Customer Email -->
25-
<div>
26-
<label for="email">Email:</label>
27-
<input
28-
type="email"
29-
id="email"
30-
name="email"
31-
required
32-
>
33-
</div>
34-
<!-- 3. T-shirt Colour (3 options) -->
35-
<div>
36-
<label for="colour">T-shirt Colour:</label>
37-
<select id="colour" name="colour" required>
38-
<option value="" disabled selected>Select a colour</option>
39-
<option value="red">Red</option>
40-
<option value="blue">Blue</option>
41-
<option value="black">Black</option>
42-
</select>
43-
</div>
44-
<!-- 4. T-shirt Size (6 options: XS, S, M, L, XL, XXL) -->
45-
<div>
46-
<label for="size">T-shirt Size:</label>
47-
<select id="size" name="size" required>
48-
<option value="" disabled selected>Select a size</option>
49-
<option value="XS">XS</option>
50-
<option value="S">S</option>
51-
<option value="M">M</option>
52-
<option value="L">L</option>
53-
<option value="XL">XL</option>
54-
<option value="XXL">XXL</option>
55-
</select>
56-
</div>
19+
<div>
20+
<label for="name">Full Name:</label>
21+
<input type="text" id="name" name="name" required>
22+
</div>
23+
24+
<div>
25+
<label for="email">Email Address:</label>
26+
<input type="email" id="email" name="email" required>
27+
</div>
28+
29+
<!-- T-shirt Colour (Radio buttons) -->
30+
<fieldset>
31+
<legend>T-shirt Colour:</legend>
32+
33+
<div>
34+
<input type="radio" id="colour-red" name="colour" value="red" required>
35+
<label for="colour-red">Red</label>
36+
</div>
37+
38+
<div>
39+
<input type="radio" id="colour-blue" name="colour" value="blue">
40+
<label for="colour-blue">Blue</label>
41+
</div>
42+
43+
<div>
44+
<input type="radio" id="colour-black" name="colour" value="black">
45+
<label for="colour-black">Black</label>
46+
</div>
47+
</fieldset>
48+
49+
<!-- T-shirt Size -->
50+
<div>
51+
<label for="size">T-shirt Size:</label>
52+
<select id="size" name="size" required>
53+
<option value="" disabled selected>Select a size</option>
54+
<option value="XS">XS</option>
55+
<option value="S">S</option>
56+
<option value="M">M</option>
57+
<option value="L">L</option>
58+
<option value="XL">XL</option>
59+
<option value="XXL">XXL</option>
60+
</select>
61+
</div>
62+
63+
<button type="submit">Submit Order</button>
64+
</form>
65+
</main>
66+
67+
<!-- 3. Footer with Name and Closing Tag -->
68+
<footer>
69+
<p>Designed and built by Quentin Gwele</p>
70+
</footer>
5771

58-
<!-- Submit Button -->
59-
<button type="submit">Submit Order</button>
60-
<header>
61-
<h1>Product Pick</h1>
62-
</header>
63-
<main>
64-
<!-- write your html here-->
65-
<!--
66-
try writing out the requirements first as comments
67-
this will also help you fill in your PR message later-->
68-
</main>
69-
<footer>
70-
<!-- change to your name-->
71-
<p>By HOMEWORK SOLUTION</p>
72-
</footer>
73-
</body>
74-
</html>
72+
</body>
73+
</html>

Form-Controls/style.css

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
body {
2+
font-family: Arial, sans-serif;
3+
max-width: 500px;
4+
margin: 30px auto;
5+
padding: 20px;
6+
background-color: #f9f9f9;
7+
}
8+
9+
header {
10+
text-align: center;
11+
margin-bottom: 20px;
12+
}
13+
14+
form {
15+
background: #ffffff;
16+
padding: 20px;
17+
border-radius: 6px;
18+
box-shadow: 0 2px 5px rgba(0,0,0,0.1);
19+
}
20+
21+
div {
22+
margin-bottom: 15px;
23+
}
24+
25+
label {
26+
display: block;
27+
margin-bottom: 5px;
28+
font-weight: bold;
29+
}
30+
31+
fieldset {
32+
border: 1px solid #ccc;
33+
border-radius: 4px;
34+
padding: 10px;
35+
margin-bottom: 15px;
36+
}
37+
38+
fieldset div {
39+
display: inline-block;
40+
margin-right: 15px;
41+
margin-bottom: 0;
42+
}
43+
44+
fieldset label {
45+
display: inline;
46+
font-weight: normal;
47+
}
48+
49+
select, input[type="text"], input[type="email"] {
50+
width: 100%;
51+
padding: 8px;
52+
border: 1px solid #ccc;
53+
border-radius: 4px;
54+
}
55+
56+
button[type="submit"] {
57+
background-color: #0066cc;
58+
color: white;
59+
padding: 10px 18px;
60+
border: none;
61+
border-radius: 4px;
62+
cursor: pointer;
63+
}
64+
65+
footer {
66+
margin-top: 20px;
67+
text-align: center;
68+
font-size: 14px;
69+
color: #666;
70+
}

0 commit comments

Comments
 (0)