Skip to content

Commit d123b42

Browse files
Add form structure
1 parent c44123d commit d123b42

2 files changed

Lines changed: 100 additions & 24 deletions

File tree

Form-Controls/index.html

Lines changed: 66 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,69 @@
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>
11-
<header>
12-
<h1>Product Pick</h1>
13-
</header>
14-
<main>
15-
<form>
16-
<!-- write your html here-->
17-
<!--
18-
try writing out the requirements first as comments
19-
this will also help you fill in your PR message later-->
20-
</form>
21-
</main>
22-
<footer>
23-
<!-- change to your name-->
24-
<p>By HOMEWORK SOLUTION</p>
25-
</footer>
26-
</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+
8+
<!-- Link to CSS file -->
9+
<link rel="stylesheet" href="style.css">
10+
</head>
11+
12+
<body>
13+
<main>
14+
<h1>T-Shirt Order Form</h1>
15+
16+
<form>
17+
<!-- Customer Name -->
18+
<div>
19+
<label for="name">Customer Name</label>
20+
<input
21+
type="text"
22+
id="name"
23+
name="name"
24+
pattern=".*\S.*\S.*"
25+
required
26+
>
27+
</div>
28+
29+
<!-- Email -->
30+
<div>
31+
<label for="email">Email Address</label>
32+
<input
33+
type="email"
34+
id="email"
35+
name="email"
36+
required
37+
>
38+
</div>
39+
40+
<!-- Colour -->
41+
<div>
42+
<label for="colour">Choose a Colour</label>
43+
<select id="colour" name="colour" required>
44+
<option value="">Select a colour</option>
45+
<option value="black">Black</option>
46+
<option value="white">White</option>
47+
<option value="blue">Blue</option>
48+
</select>
49+
</div>
50+
51+
<!-- Size -->
52+
<div>
53+
<label for="size">Choose a Size</label>
54+
<select id="size" name="size" required>
55+
<option value="">Select a size</option>
56+
<option value="XS">XS</option>
57+
<option value="S">S</option>
58+
<option value="M">M</option>
59+
<option value="L">L</option>
60+
<option value="XL">XL</option>
61+
<option value="XXL">XXL</option>
62+
</select>
63+
</div>
64+
65+
<button type="submit">Order T-Shirt</button>
66+
</form>
67+
</main>
68+
</body>
2769
</html>

Form-Controls/style.css

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
body {
2+
font-family: Arial, sans-serif;
3+
max-width: 600px;
4+
margin: 40px auto;
5+
padding: 20px;
6+
}
7+
8+
h1 {
9+
text-align: center;
10+
}
11+
12+
form {
13+
display: flex;
14+
flex-direction: column;
15+
gap: 16px;
16+
}
17+
18+
label {
19+
display: block;
20+
margin-bottom: 5px;
21+
font-weight: bold;
22+
}
23+
24+
input,
25+
select,
26+
button {
27+
width: 100%;
28+
padding: 10px;
29+
box-sizing: border-box;
30+
}
31+
32+
button {
33+
cursor: pointer;
34+
}

0 commit comments

Comments
 (0)