Skip to content

Commit 6694a38

Browse files
committed
Complete forms assignment
1 parent ff7b9d0 commit 6694a38

2 files changed

Lines changed: 93 additions & 18 deletions

File tree

Form-Controls/index.html

Lines changed: 44 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,53 @@
11
<!DOCTYPE html>
22
<html lang="en">
33
<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" />
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">
98
</head>
109
<body>
11-
<header>
12-
<h1>Product Pick</h1>
13-
</header>
14-
<main>
10+
<main class="container">
11+
<h1>T-Shirt Order Form</h1>
12+
1513
<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-->
14+
<div>
15+
<label for="name">Full Name</label>
16+
<input type="text" id="name"name="name" minlength="2" pattern=".*\S.*\S.*"
17+
placeholder="Enter your full name" required>
18+
</div>
19+
20+
<div>
21+
<label for="email">Email Address</label>
22+
<input type="email" id="email" name="email" placeholder="Enter your email" required>
23+
</div>
24+
25+
<div>
26+
<label for="colour">T-Shirt Colour</label>
27+
<select id="colour" name="colour" required>
28+
<option value="">Select a colour</option>
29+
<option value="black">Black</option>
30+
<option value="white">White</option>
31+
<option value="blue">Blue</option>
32+
</select>
33+
</div>
34+
35+
<div>
36+
<label for="size">T-Shirt Size</label>
37+
<select id="size" name="size" required>
38+
<option value="">Select a size</option>
39+
<option value="xs">XS</option>
40+
<option value="s">S</option>
41+
<option value="m">M</option>
42+
<option value="l">L</option>
43+
<option value="xl">XL</option>
44+
<option value="xxl">XXL</option>
45+
</select>
46+
</div>
47+
48+
<button type="submit">Place Order</button>
2049
</form>
2150
</main>
22-
<footer>
23-
<!-- change to your name-->
24-
<p>By HOMEWORK SOLUTION</p>
25-
</footer>
51+
2652
</body>
27-
</html>
53+
</html>

Form-Controls/style.css

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
body {
2+
font-family: Arial, sans-serif;
3+
background-color: #f4f4f4;
4+
margin: 0;
5+
padding: 40px;
6+
}
7+
.container {
8+
max-width: 500px;
9+
margin: 0 auto;
10+
background-color: #ffffff;
11+
padding: 30px;
12+
border-radius: 8px;
13+
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
14+
}
15+
h1 {
16+
text-align: center;
17+
margin-bottom: 24px;
18+
}
19+
form {
20+
display: flex;
21+
flex-direction: column;
22+
gap: 20px;
23+
}
24+
label {
25+
display: block;
26+
margin-bottom: 6px;
27+
font-weight: bold;
28+
}
29+
input,
30+
select {
31+
width: 100%;
32+
padding: 10px;
33+
border: 1px solid #cccccc;
34+
border-radius: 4px;
35+
font-size: 16px;
36+
box-sizing: border-box;
37+
}
38+
button {
39+
padding: 12px;
40+
border: none;
41+
background-color: #000000;
42+
color: white;
43+
font-size: 16px;
44+
border-radius: 4px;
45+
cursor: pointer;
46+
}
47+
button:hover {
48+
background-color: #2d758b;
49+
}

0 commit comments

Comments
 (0)